{"record":{"id":"449d57fd61b8d56f","repo":"Hmbown/CodeWhale","slug":"dsh-is-not-connected-run-cli-command-connect-449d57","errorCode":null,"errorMessage":"DSH is not connected; run `{CLI_COMMAND} connect` first","messagePattern":"DSH is not connected; run `(.+?) connect` first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/cli.rs","lineNumber":387,"sourceCode":"            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        }\n        DshIntegrationCommand::InstallBundle { app, yes } => {\n            let app = dsh::DshAppBundle::parse(&app)\n                .ok_or_else(|| anyhow::anyhow!(\"--app must be `web` or `headless`, got `{app}`\"))?;\n            let (paths, report) = status_report(config, workspace, false)?;\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` first\")\n            })?;\n            if let dsh::BundleAvailability::NotAvailable { reason } = &report.bundle_availability {\n                anyhow::bail!(\"DSH plugin path not available: {reason}\");\n            }\n            if matches!(report.state, DshIntegrationState::StaleConfig { .. }) {\n                anyhow::bail!(\"overlay is stale; run `{CLI_COMMAND} update` before install-bundle\");\n            }\n            let app_source = dsh::bundle::app_bundle_source(\n                report\n                    .detection\n                    .binary\n                    .as_ref()\n                    .ok_or_else(|| anyhow::anyhow!(\"dsh binary path is unknown\"))?,\n                app,\n            )?;\n            let profile_dir = report\n                .detection\n                .dsh_home","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/cli.rs#L369-L405","documentation":"`install-bundle` requires an existing connection: after `status_report` and `ensure_launchable_dsh` pass, it reads `report.record` to know the connected identity and profile. When the receipt has no current record this error fires with an explicit `connect` instruction (note the trailing `first`, distinguishing it from the update-path variant). Nothing has been written when it triggers.","triggerScenarios":"Running `codewhale integrations dsh install-bundle` when the integration was never connected, or after `codewhale integrations dsh remove` deleted the receipt. dsh itself is installed and launchable (ensure_launchable_dsh passed) — only the Codewhale connection record is missing.","commonSituations":"Trying install-bundle as the first command on a fresh machine; scripts running install-bundle after a cleanup step; teammates assuming the bundle step creates the connection too.","solutions":["Run `codewhale integrations dsh connect` first, then retry install-bundle","Verify state is `connected` via `codewhale integrations dsh status` before installing","In scripts, chain the commands: connect && install-bundle --app web --yes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let (_paths, report) = status_report(config, workspace, false)?;\nensure_launchable_dsh(&report)?;\nif report.record.is_none() {\n    println!(\"run `codewhale integrations dsh connect` first\");\n    return Ok(());\n}","typeGuard":"fn ready_for_bundle_install(report: &DshStatusReport) -> bool {\n    report.record.is_some()\n        && !matches!(report.state, DshIntegrationState::StaleConfig { .. })\n        && matches!(report.bundle_availability, dsh::BundleAvailability::Available { .. })\n}","tryCatchPattern":null,"preventionTips":["Chain commands in automation: connect && install-bundle --yes","Check status before bundle operations — one command answers record, staleness, and pnpm availability at once"],"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"}