{"record":{"id":"c816dde08a66fd89","repo":"warpdotdev/warp","slug":"user-is-not-on-a-team","errorCode":null,"errorMessage":"User is not on a team","messagePattern":"User is not on a team","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/common.rs","lineNumber":107,"sourceCode":") -> anyhow::Result<AmbientAgentTaskId> {\n    let task_id = parse_ambient_task_id(run_id, \"Invalid run ID\")?;\n    ServerApiProvider::handle(ctx)\n        .as_ref(ctx)\n        .get()\n        .set_ambient_agent_task_id(Some(task_id));\n    Ok(task_id)\n}\n\n/// Resolve the owner of a new cloud object. This resolution is based on the CLI `--team` and `--personal` flags.\n///\n/// If `team_flag` is true, attempts to get the current team UID (errors if not on a team).\n/// If `user_flag` is true, gets the current user's UID.\n/// Otherwise, defaults to team if available, falling back to user.\npub fn resolve_owner(team_flag: bool, user_flag: bool, ctx: &AppContext) -> anyhow::Result<Owner> {\n    if team_flag {\n        let team_id = UserWorkspaces::as_ref(ctx)\n            .sole_team_uid()\n            .ok_or_else(|| anyhow::anyhow!(\"User is not on a team\"))?;\n        return Ok(Owner::Team { team_uid: team_id });\n    }\n\n    if user_flag {\n        let user_id = AuthStateProvider::as_ref(ctx)\n            .get()\n            .user_id()\n            .ok_or_else(|| anyhow::anyhow!(\"User should be logged in\"))?;\n        return Ok(Owner::User { user_uid: user_id });\n    }\n\n    // Default: try team first, fall back to user\n    if let Some(team_uid) = UserWorkspaces::as_ref(ctx).sole_team_uid() {\n        return Ok(Owner::Team { team_uid });\n    }\n\n    log::warn!(\"Tried to default to creating team object, team could not be found.\");\n    let user_id = AuthStateProvider::as_ref(ctx)","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/common.rs#L89-L125","documentation":"`resolve_owner(team_flag=true, ...)` asks `UserWorkspaces::sole_team_uid()` for the user's team. `None` means the account has no team, so a team-owned cloud object cannot be created and the `--team` request fails. The `--team` flag is an explicit demand, so no user fallback is attempted.","triggerScenarios":"Passing `--team` to a command that resolves a cloud-object owner via resolve_owner while the logged-in user's workspace metadata contains no sole team uid.","commonSituations":"Personal accounts with no team; workspace metadata not yet synced after joining a team; fresh login before metadata refresh; multiple-team edge cases.","solutions":["Drop `--team` or use `--personal` to create a user-owned object","Verify team membership in the Warp app / team settings","Refresh workspace metadata (re-login or restart the client) and retry","If you just joined a team, retry after metadata sync completes"],"exampleFix":"# before\nwarp launch-configs create --team my-config\n# after (personal account)\nwarp launch-configs create --personal my-config","handlingStrategy":"validation","validationCode":"fn team_flag_usable(ctx: &AppContext) -> bool {\n    UserWorkspaces::as_ref(ctx).sole_team_uid().is_some()\n}\n// Disable --team flows when false; default to --personal.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check sole_team_uid() before offering --team","Refresh workspace metadata after login/team changes","Default to --personal on personal accounts"],"tags":["team","auth","cloud-objects","cli"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}