{"record":{"id":"a9132d945f56a4c6","repo":"warpdotdev/warp","slug":"provider-must-be-setup-for-either-a-team-or-p","errorCode":null,"errorMessage":"Provider '{}' must be setup for either a team or personal account","messagePattern":"Provider '(.+?)' must be setup for either a team or personal account","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/provider.rs","lineNumber":48,"sourceCode":"\nimpl ProviderCommandRunner {\n    // This shouldn't need to be done, it's usually done as part of create\n    fn setup(\n        &self,\n        provider_type: ProviderType,\n        team: bool,\n        personal: bool,\n        ctx: &mut ModelContext<Self>,\n    ) -> anyhow::Result<()> {\n        // Construct the OAuth connect URL\n        let server_url = ChannelState::server_root_url();\n\n        let mut use_team_auth = team;\n        if !team && !personal {\n            if provider_type.allowed_in_team_context()\n                && 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            };","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/provider.rs#L30-L66","documentation":"Provider setup is ambiguous: neither --team nor --personal was passed, and this provider type is allowed in both contexts (allowed_in_team_context() and allowed_in_personal_context() both true), so the SDK cannot decide which principal the OAuth connection attaches to and errors instead of guessing.","triggerScenarios":"`warp provider setup <slug>` with no scope flag for a provider that supports both team and personal contexts.","commonSituations":"Copy-pasting a setup command from docs that omit the scope; new provider integrations where the user does not know which scope they need; wrappers that forward flags verbatim and drop the scope.","solutions":["Pass --team to attach the provider to your team, or --personal for your user account","Check `warp provider list` to see which scopes the provider supports","Pass the explicit flag even when you have only one possible context — it removes the ambiguity"],"exampleFix":"# before\nwarp provider setup github\n\n# after\nwarp provider setup github --team","handlingStrategy":"validation","validationCode":"# Require an explicit scope in wrappers instead of relying on defaults\nscope=\"${1:?pass --team or --personal}\"\nwarp provider setup \"$slug\" \"$scope\"","typeGuard":null,"tryCatchPattern":"out=$(warp provider setup \"$slug\" 2>&1) || { case \"$out\" in *'must be setup for either a team or personal'*) echo 'choose --team or --personal' >&2; exit 1;; *) echo \"$out\" >&2; exit 1;; esac; }","preventionTips":["Always pass an explicit scope flag, even when you think one is implied","Check the provider's supported scopes with provider list before setup"],"tags":["provider","oauth","cli","arguments"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}