{"record":{"id":"5517751d7a09f46f","repo":"Hmbown/CodeWhale","slug":"dsh-exited-with-status-code","errorCode":null,"errorMessage":"dsh exited with status {code}","messagePattern":"dsh exited with status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/cli.rs","lineNumber":362,"sourceCode":"                record.overlay_path.display(),\n                record.overlay_sha256\n            );\n            Ok(())\n        }\n        DshIntegrationCommand::Launch {\n            profile,\n            dry_run,\n            args,\n        } => {\n            let (_paths, report) = status_report(config, workspace, false)?;\n            let spec = dsh::launch_spec(&report, profile.as_deref(), &args, workspace)?;\n            println!(\"{RELATIONSHIP_LABEL}: {}\", spec.display());\n            if dry_run {\n                return Ok(());\n            }\n            let code = dsh::spawn_launch(&spec)?;\n            if code != 0 {\n                anyhow::bail!(\"dsh exited with status {code}\");\n            }\n            Ok(())\n        }\n        DshIntegrationCommand::Disable => {\n            let paths = DshPaths::from_process()?;\n            let record = dsh::set_disabled(&paths, true)?;\n            println!(\n                \"disabled: overlay kept at {}; launches refused\",\n                record.overlay_path.display()\n            );\n            Ok(())\n        }\n        DshIntegrationCommand::Enable => {\n            let paths = DshPaths::from_process()?;\n            let record = dsh::set_disabled(&paths, false)?;\n            println!(\"enabled: {}\", record.overlay_path.display());\n            Ok(())\n        }","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/cli.rs#L344-L380","documentation":"After `dsh::launch_spec` builds and prints the launch command, `dsh::spawn_launch` runs `dsh --profile <p> [--patch <overlay>]` with `DSH_PERMISSION_MODE` exported and provider key env vars stripped (dsh/mod.rs:694-707). This error means the dsh child process started but exited non-zero — the failure is inside dsh, not in the Codewhale integration layer. A child killed by a signal is reported as code 1 via `status.code().unwrap_or(1)`.","triggerScenarios":"`codewhale integrations dsh launch` without `--dry-run` when dsh exits non-zero: no DEEPSEEK_API_KEY and no `$DSH_HOME/.credentials.yaml`, an invalid profile name, the overlay pinning a model/base_url that rejects requests, or dsh crashing. Exit code 1 can also mean the process was terminated by a signal.","commonSituations":"First launch on a machine where dsh has never been authenticated; the pinned model was renamed provider-side so every request fails; `DSH_PERMISSION_MODE=read-only` blocking a write the session attempted; proxies or offline environments blocking the endpoint; OOM or terminal teardown killing the child.","solutions":["Re-run the printed launch spec manually (it is printed before spawn, e.g. `dsh --profile web --patch <overlay>`) to see dsh's own error output","Provide dsh credentials: `DEEPSEEK_API_KEY` in dsh's environment or `$DSH_HOME/.credentials.yaml` — Codewhale deliberately hands over no key","Treat code 1 with no dsh diagnostics as a possible signal kill: check dmesg/OOM and whether the terminal was resized or closed","Verify the pinned identity is still valid provider-side via `codewhale integrations dsh status`, then `update` if the model or base_url drifted"],"exampleFix":"// before\nlet code = dsh::spawn_launch(&spec)?;\nif code != 0 {\n    anyhow::bail!(\"dsh exited with status {code}\");\n}\n\n// after — keep the spec visible so the user can reproduce dsh's own failure\nlet code = dsh::spawn_launch(&spec)?;\nif code != 0 {\n    eprintln!(\"to reproduce: {}\", spec.display());\n    anyhow::bail!(\"dsh exited with status {code}; rerun the command above to see dsh's own output\");\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match dsh::spawn_launch(&spec) {\n    Ok(0) => Ok(()),\n    Ok(code) => {\n        // child ran and failed: keep spec.display() visible so the user can\n        // rerun dsh manually and see its own diagnostics\n        eprintln!(\"to reproduce: {}\", spec.display());\n        Err(anyhow::anyhow!(\"dsh exited with status {code}\"))\n    }\n    Err(e) => Err(e), // spawn-level failure: binary missing, permissions\n}","preventionTips":["Use `launch --dry-run` first — it prints the exact spec without spawning","Ensure dsh credentials exist before launching: DEEPSEEK_API_KEY or $DSH_HOME/.credentials.yaml (Codewhale never forwards keys)","After changing provider config, run `update` so the overlay pins a route that actually works"],"tags":["rust","dsh","process","launch","exit-code"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}