{"record":{"id":"3d60c7154e9297cf","repo":"Hmbown/CodeWhale","slug":"dsh-is-not-connected-run-cli-command-connect","errorCode":null,"errorMessage":"DSH is not connected; run `{CLI_COMMAND} connect`","messagePattern":"DSH is not connected; run `(.+?) connect`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/cli.rs","lineNumber":324,"sourceCode":"                dsh::apply_plan(&paths, &report.detection, &plan, DshReceiptEvent::Connect)?;\n            println!(\n                \"connected: {} (sha256 {})\",\n                record.overlay_path.display(),\n                record.overlay_sha256\n            );\n            println!(\"receipt: {}\", paths.receipt.display());\n            Ok(())\n        }\n        DshIntegrationCommand::Update {\n            profile,\n            allow_full_access,\n            skin,\n            yes,\n        } => {\n            let (paths, report) = status_report(config, workspace, allow_full_access)?;\n            ensure_launchable_dsh(&report)?;\n            let record = report.record.as_ref().ok_or_else(|| {\n                anyhow::anyhow!(\"DSH is not connected; run `{CLI_COMMAND} connect`\")\n            })?;\n            let profile = profile.unwrap_or_else(|| record.profile.clone());\n            let skin = skin.unwrap_or(record.skin_enabled);\n            let identity = dsh::codewhale_route_identity(config, workspace)\n                .map_err(|e| anyhow::anyhow!(\"cannot resolve the current Codewhale route: {e}\"))?;\n            let plan = dsh::plan(\n                &paths,\n                &report.detection,\n                &identity,\n                &profile,\n                allow_full_access,\n                skin,\n            )?;\n            print_plan(&plan, \"update\");\n            confirm(yes, \"Rewrite the Codewhale overlay for DSH?\")?;\n            let record =\n                dsh::apply_plan(&paths, &report.detection, &plan, DshReceiptEvent::Update)?;\n            println!(","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/cli.rs#L306-L342","documentation":"Thrown by `codewhale integrations dsh update` when the status report carries no connection record (`report.record` is None). `update` only rewrites an existing overlay: it inherits the current profile and skin setting from that record (`record.profile`, `record.skin_enabled`), so without a prior `connect` there is nothing to update from. Note that `ensure_launchable_dsh` already passed, so dsh itself is installed and usable — only the Codewhale-side receipt is missing.","triggerScenarios":"Running `codewhale integrations dsh update` when `$CODEWHALE_HOME/integrations/dsh/receipt.json` has no current connection entry: the integration was never connected, `codewhale integrations dsh remove` deleted the receipt, or receipt.json was removed/edited by hand.","commonSituations":"Fresh machines where dsh is installed but `connect` was never run; CI or provisioning scripts that assume `update` is idempotent from a clean state; right after `remove`, which deletes the receipt by design.","solutions":["Run `codewhale integrations dsh connect` to create the overlay and receipt, then retry `update`","Confirm the state flipped to `connected` with `codewhale integrations dsh status` before re-running update","If you previously ran `remove`, connect again instead of restoring old files — removal deletes the receipt by design","If `connect` itself fails, check that `$CODEWHALE_HOME/integrations/dsh/` is writable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let (_paths, report) = status_report(config, workspace, allow_full_access)?;\nif !dsh_connected(&report) {\n    println!(\"run `codewhale integrations dsh connect` first\");\n    return Ok(());\n}","typeGuard":"fn dsh_connected(report: &DshStatusReport) -> bool {\n    report.record.is_some()\n        && matches!(\n            report.state,\n            DshIntegrationState::Connected { .. } | DshIntegrationState::StaleVersion { .. }\n        )\n}","tryCatchPattern":null,"preventionTips":["Treat update as a second step: scripts should run connect (idempotent) or check status before update","Key flows off the typed state enum, never off string labels, so Connected vs Detected cannot be confused","Surface the connect hint in the UI instead of surfacing the bail as a raw error"],"tags":["rust","dsh","cli","integration","state"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}