{"record":{"id":"afdd67d6c1c06ba4","repo":"warpdotdev/warp","slug":"user-is-not-on-a-team-afdd67","errorCode":null,"errorMessage":"User is not on a team","messagePattern":"User is not on a team","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/provider.rs","lineNumber":64,"sourceCode":"                && provider_type.allowed_in_personal_context()\n            {\n                return Err(anyhow::anyhow!(\n                    \"Provider '{}' must be setup for either a team or personal account\",\n                    provider_type.slug()\n                ));\n            }\n            use_team_auth = provider_type.allowed_in_team_context();\n        } else if personal {\n            use_team_auth = false;\n        }\n\n        // TODO(bens): initiate the OAuth flow and use the login-less auth URL\n        let slug = provider_type.slug();\n        let url = if use_team_auth {\n            let team_uid = match UserWorkspaces::as_ref(ctx).sole_team_uid() {\n                Some(uid) => uid,\n                None => {\n                    return Err(anyhow::anyhow!(\"User is not on a team\"));\n                }\n            };\n            format!(\"{server_url}/oauth/connect/{slug}?principalType=team&principalId={team_uid}\")\n        } else {\n            format!(\"{server_url}/oauth/connect/{slug}\")\n        };\n\n        println!(\"To authenticate {slug}, open this URL in your browser: {url}\");\n\n        // Open the URL in the default browser\n        ctx.open_url(&url);\n\n        // TODO(bens): poll/subscribe until connection is created\n\n        ctx.terminate_app(TerminationMode::ForceTerminate, None);\n\n        Ok(())\n    }","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/provider.rs#L46-L82","documentation":"A team-scoped OAuth connect URL needs a team principal, resolved via UserWorkspaces.sole_team_uid(). If no single team can be resolved for the logged-in user, the URL cannot be built and the command fails. Note the comment: the login-less auth flow is still a TODO, so this path is early.","triggerScenarios":"`warp provider setup <slug> --team` (or a team-only provider where use_team_auth defaults true) when the user belongs to no team, or workspace metadata has not refreshed the team list yet.","commonSituations":"New accounts that have not accepted a team invite; running immediately after joining a team with stale metadata; logged into a personal account while following team-oriented instructions.","solutions":["Accept the team invitation and confirm you are logged into the right account","Re-run so workspace metadata refreshes with the new team membership","If the provider allows personal context, use --personal instead"],"exampleFix":"# before\nwarp provider setup github --team   # account has no team\n\n# after\nwarp provider setup github --personal   # or join a team first, then retry","handlingStrategy":"validation","validationCode":"# Team-scoped setup needs a resolvable team; check membership first\nteam_uid=$(warp whoami --output-format json 2>/dev/null | jq -r '.teams[0].uid // empty')\n[ -n \"$team_uid\" ] || { echo 'no team on this account; use --personal if the provider allows' >&2; exit 1; }\nwarp provider setup \"$slug\" --team","typeGuard":null,"tryCatchPattern":"out=$(warp provider setup \"$slug\" --team 2>&1) || { case \"$out\" in *'User is not on a team'*) warp provider setup \"$slug\" --personal || { echo \"$out\" >&2; exit 1; };; *) echo \"$out\" >&2; exit 1;; esac; }","preventionTips":["Accept team invites and verify membership before team-scoped provider setup","Re-run once after joining so workspace metadata refreshes","Confirm you are logged into the account that belongs to the team"],"tags":["provider","team","oauth","workspace"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}