Hmbown/CodeWhale · error

DSH is not connected; run `{CLI_COMMAND} connect`

Error message

DSH is not connected; run `{CLI_COMMAND} connect`

What it means

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.

Source

Thrown at crates/tui/src/integrations/cli.rs:324

                dsh::apply_plan(&paths, &report.detection, &plan, DshReceiptEvent::Connect)?;
            println!(
                "connected: {} (sha256 {})",
                record.overlay_path.display(),
                record.overlay_sha256
            );
            println!("receipt: {}", paths.receipt.display());
            Ok(())
        }
        DshIntegrationCommand::Update {
            profile,
            allow_full_access,
            skin,
            yes,
        } => {
            let (paths, report) = status_report(config, workspace, allow_full_access)?;
            ensure_launchable_dsh(&report)?;
            let record = report.record.as_ref().ok_or_else(|| {
                anyhow::anyhow!("DSH is not connected; run `{CLI_COMMAND} connect`")
            })?;
            let profile = profile.unwrap_or_else(|| record.profile.clone());
            let skin = skin.unwrap_or(record.skin_enabled);
            let identity = dsh::codewhale_route_identity(config, workspace)
                .map_err(|e| anyhow::anyhow!("cannot resolve the current Codewhale route: {e}"))?;
            let plan = dsh::plan(
                &paths,
                &report.detection,
                &identity,
                &profile,
                allow_full_access,
                skin,
            )?;
            print_plan(&plan, "update");
            confirm(yes, "Rewrite the Codewhale overlay for DSH?")?;
            let record =
                dsh::apply_plan(&paths, &report.detection, &plan, DshReceiptEvent::Update)?;
            println!(

View on GitHub (pinned to 8880682c63)

Solutions

  1. Run `codewhale integrations dsh connect` to create the overlay and receipt, then retry `update`
  2. Confirm the state flipped to `connected` with `codewhale integrations dsh status` before re-running update
  3. If you previously ran `remove`, connect again instead of restoring old files — removal deletes the receipt by design
  4. If `connect` itself fails, check that `$CODEWHALE_HOME/integrations/dsh/` is writable
Defensive patterns

Strategy: validation

Validate before calling

let (_paths, report) = status_report(config, workspace, allow_full_access)?;
if !dsh_connected(&report) {
    println!("run `codewhale integrations dsh connect` first");
    return Ok(());
}

Type guard

fn dsh_connected(report: &DshStatusReport) -> bool {
    report.record.is_some()
        && matches!(
            report.state,
            DshIntegrationState::Connected { .. } | DshIntegrationState::StaleVersion { .. }
        )
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/3d60c7154e9297cf. Report an issue: GitHub.