{"record":{"id":"80eb5b45479380ed","repo":"zed-industries/zed","slug":"no-organization-selected-80eb5b","errorCode":null,"errorMessage":"No organization selected.","messagePattern":"No organization selected\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/language_models/src/provider/cloud.rs","lineNumber":59,"sourceCode":"    type AuthContext = Option<OrganizationId>;\n\n    fn auth_context(&self, cx: &impl AppContext) -> Self::AuthContext {\n        self.user_store.read_with(cx, |user_store, _| {\n            user_store\n                .current_organization()\n                .map(|organization| organization.id.clone())\n        })\n    }\n\n    fn cached_token(\n        &self,\n        organization_id: Self::AuthContext,\n    ) -> BoxFuture<'static, Result<String>> {\n        let client = self.client.clone();\n        let llm_api_token = self.llm_api_token.clone();\n        Box::pin(async move {\n            let organization_id =\n                organization_id.ok_or_else(|| anyhow!(\"No organization selected.\"))?;\n            client\n                .cached_llm_token(&llm_api_token, organization_id)\n                .await\n        })\n    }\n\n    fn refresh_token(\n        &self,\n        organization_id: Self::AuthContext,\n    ) -> BoxFuture<'static, Result<String>> {\n        let client = self.client.clone();\n        let llm_api_token = self.llm_api_token.clone();\n        Box::pin(async move {\n            let organization_id =\n                organization_id.ok_or_else(|| anyhow!(\"No organization selected.\"))?;\n            client\n                .refresh_llm_token(&llm_api_token, organization_id)\n                .await","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/language_models/src/provider/cloud.rs#L41-L77","documentation":"Sentinel guard in Zed Cloud's cached_token: the auth layer requires an organization scope for token retrieval, but user_store.current_organization() returned None, so no token can be cached or fetched. Fires when the user is signed in without an active organization or not signed in at all.","triggerScenarios":"Thrown at crates/language_models/src/provider/cloud.rs:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Sign in to Zed Cloud and select/switch to an organization before using cloud models","Re-authenticate if the session lost its organization membership"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}