{"record":{"id":"e055e87a5a293e14","repo":"Hmbown/CodeWhale","slug":"dsh-is-detected-but-not-connected-run-cli-comma","errorCode":null,"errorMessage":"DSH is detected but not connected; run `{CLI_COMMAND} connect`","messagePattern":"DSH is detected but not connected; run `(.+?) connect`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/mod.rs","lineNumber":699,"sourceCode":"        match &report.state {\n            DshIntegrationState::Connected { .. } | DshIntegrationState::StaleVersion { .. } => {}\n            DshIntegrationState::Disabled { .. } => {\n                anyhow::bail!(\n                    \"DSH integration is disabled; run `{CLI_COMMAND} enable` to launch again\"\n                )\n            }\n            DshIntegrationState::StaleConfig { reason, .. } => {\n                anyhow::bail!(\n                    \"DSH overlay is stale ({reason}); run `{CLI_COMMAND} update` before launching\"\n                )\n            }\n            DshIntegrationState::Incompatible { reason, .. } => {\n                anyhow::bail!(\"installed dsh is incompatible: {reason}\")\n            }\n            DshIntegrationState::Offline { reason } => anyhow::bail!(\"dsh is offline: {reason}\"),\n            DshIntegrationState::NotInstalled => anyhow::bail!(\"dsh is not installed\"),\n            DshIntegrationState::Detected { .. } => {\n                anyhow::bail!(\"DSH is detected but not connected; run `{CLI_COMMAND} connect`\")\n            }\n        }\n    }\n    let binary = report\n        .detection\n        .binary\n        .clone()\n        .ok_or_else(|| anyhow::anyhow!(\"dsh binary path is unknown\"))?;\n    let bundle_installed = record.bundle.is_some();\n    let profile = profile_override.unwrap_or(if bundle_installed {\n        bundle::BUNDLE_PROFILE\n    } else {\n        record.profile.as_str()\n    });\n    if !matches!(profile, \"web\" | \"headless\") && profile != bundle::BUNDLE_PROFILE {\n        anyhow::bail!(\n            \"DSH profile must be `web`, `headless`, or `{}` (bundle), got `{profile}`\",\n            bundle::BUNDLE_PROFILE","sourceCodeStart":681,"sourceCodeEnd":717,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/integrations/dsh/mod.rs#L681-L717","documentation":"launch_spec fails when dsh is installed and detected but no Codewhale identity/receipt has been recorded for it: the integration saw the binary (DshIntegrationState::Detected) but `codewhale dsh connect` was never completed. Without a connected record there is no profile/identity to launch with.","triggerScenarios":"Running a launch path through dsh::launch_spec right after installing dsh, or after the receipt was deleted/reset, before ever running `codewhale dsh connect`.","commonSituations":"Fresh setup where the user skipped the connect step; receipt/config directory wiped or moved; dsh reinstalled into a new location so the prior connection record no longer matches.","solutions":["Run `codewhale dsh connect` to establish the integration and write the receipt.","Verify with `codewhale dsh status` that the state is Connected before launching.","If connect fails, check dsh authentication/credentials first, then retry launch."],"exampleFix":"// before\ncodewhale launch  # Error: DSH is detected but not connected\n\n// after\ncodewhale dsh connect\ncodewhale launch","handlingStrategy":"validation","validationCode":"let status = codewhale_dsh_status()?;\nif status.record.is_none() {\n    eprintln!(\"run `codewhale dsh connect` before launching\");\n    return Err(...);\n}","typeGuard":"fn is_connected(status: &DshStatusReport) -> bool {\n    status.record.is_some()\n}","tryCatchPattern":"match launch_spec(&report, None, &[], &ws) {\n    Err(e) if e.to_string().contains(\"not connected\") => {\n        run_dsh_connect()?;\n        launch_spec(&report, None, &[], &ws)?;\n    }\n    other => other?,\n}","preventionTips":["Make `codewhale dsh connect` part of setup/onboarding docs.","Do not delete or reset the receipt directory during cleanup.","Check `dsh status` shows Connected before scripting launches."],"tags":["dsh","setup","not-connected"],"backgroundTag":"authentication-required","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}