{"record":{"id":"79bb2f734845898d","repo":"zed-industries/zed","slug":"exited-before-logging-in","errorCode":null,"errorMessage":"exited before logging in","messagePattern":"exited before logging in","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/conversation_view.rs","lineNumber":2196,"sourceCode":"                    .read_with(cx, |terminal, cx| terminal.wait_for_completed_task(cx))?\n                    .await;\n\n                match exit_status {\n                    Some(status) if status.success() => Ok(()),\n                    Some(status) => Err(anyhow!(\n                        \"Login command failed with exit code: {:?}\",\n                        status.code()\n                    )),\n                    None => Err(anyhow!(\"Login command terminated without exit status\")),\n                }\n            } else {\n                // Look for specific output patterns to detect successful login\n                let mut exit_status = terminal\n                    .read_with(cx, |terminal, cx| terminal.wait_for_completed_task(cx))?\n                    .fuse();\n\n                let logged_in = cx\n                    .spawn({\n                        let terminal = terminal.clone();\n                        async move |cx| {\n                            loop {\n                                cx.background_executor().timer(Duration::from_secs(1)).await;\n                                let content =\n                                    terminal.update(cx, |terminal, _cx| terminal.get_content())?;\n                                if success_patterns\n                                    .iter()\n                                    .any(|pattern| content.contains(pattern))\n                                {\n                                    return anyhow::Ok(());\n                                }\n                            }\n                        }\n                    })\n                    .fuse();\n                futures::pin_mut!(logged_in);\n                futures::select_biased! {","sourceCodeStart":2178,"sourceCodeEnd":2214,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent_ui/src/conversation_view.rs#L2178-L2214","documentation":"Emitted in the external-agent login polling loop: the login terminal task exited with a non-success exit status before any configured success pattern (e.g. \"Login successful\") appeared in the terminal content. The offending condition is the login command failing — wrong credentials, expired link, or CLI misconfiguration — detected via task exit while polling for the success marker.","triggerScenarios":"Thrown at crates/agent_ui/src/conversation_view.rs:2189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the login flow and follow the CLI's prompts or URL flow","Verify credentials and auth configuration for the agent CLI","Check the terminal content for the CLI's own error message before exit"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}