Hmbown/CodeWhale · error · anyhow::Error
DSH is detected but not connected; run
Error message
DSH is detected but not connected; run `{CLI_COMMAND} connect` What it means
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.
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.
Example fix
// before codewhale launch # Error: DSH is detected but not connected // after codewhale dsh connect codewhale launch
Defensive patterns
Strategy: validation
Validate before calling
let status = codewhale_dsh_status()?;
if status.record.is_none() {
eprintln!("run `codewhale dsh connect` before launching");
return Err(...);
} Type guard
fn is_connected(status: &DshStatusReport) -> bool {
status.record.is_some()
} Try / catch
match launch_spec(&report, None, &[], &ws) {
Err(e) if e.to_string().contains("not connected") => {
run_dsh_connect()?;
launch_spec(&report, None, &[], &ws)?;
}
other => other?,
} Prevention
- 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.
When it happens
Trigger: 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`.
Common situations: 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.
Related errors
- DSH is not connected; run
- --app must be `web` or `headless`, got
- bundle already installed; use
- cannot locate the installed dsh package root from
- cannot resolve the current Codewhale route
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/e055e87a5a293e14.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/integrations/dsh/mod.rs:699
match &report.state {
DshIntegrationState::Connected { .. } | DshIntegrationState::StaleVersion { .. } => {}
DshIntegrationState::Disabled { .. } => {
anyhow::bail!(
"DSH integration is disabled; run `{CLI_COMMAND} enable` to launch again"
)
}
DshIntegrationState::StaleConfig { reason, .. } => {
anyhow::bail!(
"DSH overlay is stale ({reason}); run `{CLI_COMMAND} update` before launching"
)
}
DshIntegrationState::Incompatible { reason, .. } => {
anyhow::bail!("installed dsh is incompatible: {reason}")
}
DshIntegrationState::Offline { reason } => anyhow::bail!("dsh is offline: {reason}"),
DshIntegrationState::NotInstalled => anyhow::bail!("dsh is not installed"),
DshIntegrationState::Detected { .. } => {
anyhow::bail!("DSH is detected but not connected; run `{CLI_COMMAND} connect`")
}
}
}
let binary = report
.detection
.binary
.clone()
.ok_or_else(|| anyhow::anyhow!("dsh binary path is unknown"))?;
let bundle_installed = record.bundle.is_some();
let profile = profile_override.unwrap_or(if bundle_installed {
bundle::BUNDLE_PROFILE
} else {
record.profile.as_str()
});
if !matches!(profile, "web" | "headless") && profile != bundle::BUNDLE_PROFILE {
anyhow::bail!(
"DSH profile must be `web`, `headless`, or `{}` (bundle), got `{profile}`",
bundle::BUNDLE_PROFILEView on GitHub (pinned to 73e0f67d83)