{"record":{"id":"e92b3fc4f4df3596","repo":"zed-industries/zed","slug":"must-sign-in-before-using-copilot","errorCode":null,"errorMessage":"must sign in before using copilot","messagePattern":"must sign in before using copilot","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/copilot/src/copilot.rs","lineNumber":67,"sourceCode":"    copilot_edit_predictions,\n    [\n        /// Reinstalls the Copilot Edit Predictions language server.\n        #[action(deprecated_aliases = [\"copilot::Reinstall\"])]\n        Reinstall,\n    ]\n);\n\nenum CopilotServer {\n    Disabled,\n    Starting { task: Shared<Task<()>> },\n    Error(Arc<str>),\n    Running(RunningCopilotServer),\n}\n\nimpl CopilotServer {\n    fn as_authenticated(&mut self) -> Result<&mut RunningCopilotServer> {\n        let server = self.as_running()?;\n        anyhow::ensure!(\n            matches!(server.sign_in_status, SignInStatus::Authorized),\n            \"must sign in before using copilot\"\n        );\n        Ok(server)\n    }\n\n    fn as_running(&mut self) -> Result<&mut RunningCopilotServer> {\n        match self {\n            CopilotServer::Starting { .. } => anyhow::bail!(\"copilot is still starting\"),\n            CopilotServer::Disabled => anyhow::bail!(\"copilot is disabled\"),\n            CopilotServer::Error(error) => {\n                anyhow::bail!(\"copilot was not started because of an error: {error}\")\n            }\n            CopilotServer::Running(server) => Ok(server),\n        }\n    }\n}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/copilot/src/copilot.rs#L49-L85","documentation":"as_authenticated asserts the Copilot server's sign_in_status is Authorized; any other state (NotSignedIn, SigningIn, Error) fails this guard. It is a precondition check — the caller attempted a Copilot request before sign-in completed.","triggerScenarios":"Thrown at crates/copilot/src/copilot.rs:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Complete Copilot sign-in (e.g. the sign-in action) before issuing requests","If sign-in is in progress, wait for it to finish before retrying"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}