Hmbown/CodeWhale · error

dsh plugin add {} failed: {}

Error message

dsh plugin add {} failed: {}

What it means

`install_into_profile` runs two `dsh plugin --profile codewhale add` commands in order — first the app bundle (`@deepseek-ai/dsh-<app>` linked from the launcher), then the Codewhale bundle so its rows patch last. This error fires when the first add fails: `run_dsh_plugin` reports success=false and the message embeds the command's `output_excerpt`, so dsh/pnpm's own diagnostic text is part of the error. Nothing Codewhale-owned has been added yet at this point.

Source

Thrown at crates/tui/src/integrations/dsh/bundle.rs:338

pub(crate) fn install_into_profile(
    runner: &dyn DshRunner,
    detection: &DshDetection,
    app: DshAppBundle,
    bundle_dir: &Path,
) -> Result<(PathBuf, Vec<PluginCommandOutcome>)> {
    let binary = detection
        .binary
        .as_ref()
        .ok_or_else(|| anyhow::anyhow!("dsh binary is unknown"))?;
    let app_source = app_bundle_source(binary, app)?;
    let mut outcomes = Vec::new();
    let app_source_str = app_source.display().to_string();
    let first = run_dsh_plugin(runner, binary, BUNDLE_PROFILE, &["add", &app_source_str])?;
    let first_ok = first.success;
    let first_excerpt = first.output_excerpt.clone();
    outcomes.push(first);
    if !first_ok {
        anyhow::bail!(
            "dsh plugin add {} failed: {}",
            app.package_name(),
            first_excerpt
        );
    }
    let bundle_str = bundle_dir.display().to_string();
    let second = run_dsh_plugin(runner, binary, BUNDLE_PROFILE, &["add", &bundle_str])?;
    let second_ok = second.success;
    let second_excerpt = second.output_excerpt.clone();
    outcomes.push(second);
    if !second_ok {
        anyhow::bail!("dsh plugin add {BUNDLE_PACKAGE_NAME} failed: {second_excerpt}");
    }
    Ok((app_source, outcomes))
}

pub(crate) fn remove_from_profile(
    runner: &dyn DshRunner,

View on GitHub (pinned to 8880682c63)

Solutions

  1. Read the output_excerpt in the error — it is dsh/pnpm's own failure text and names the real cause
  2. Fix network/registry access (proxy, auth, mirror) and retry; the add is re-runnable
  3. Check permissions on `$DSH_HOME/profiles/codewhale` — it must be writable by the current user
  4. If pnpm's store lock is held, stop other pnpm processes and retry install-bundle
Defensive patterns

Strategy: retry

Validate before calling

let app_source = dsh::bundle::app_bundle_source(binary, app)?; // fails early on bad layout
if !app_source.is_dir() {
    eprintln!("app bundle source missing: {}", app_source.display());
    return Ok(());
}
// ensure the profile dir is writable before invoking dsh plugin
let profile_dir = detection.dsh_home.join("profiles").join(dsh::bundle::BUNDLE_PROFILE);
let writable = std::fs::metadata(&profile_dir).map(|m| !m.permissions().readonly()).unwrap_or(true);

Try / catch

match dsh::bundle::install_into_profile(runner, &detection, app, &bundle_dir) {
    Ok((_, outcomes)) => Ok(outcomes),
    Err(e) => {
        // the error embeds run_dsh_plugin's output_excerpt; surface it verbatim
        // and treat transient pnpm failures (network, store lock) as retryable
        eprintln!("plugin add failed (excerpt included in error): {e:#}");
        Err(e)
    }
}

Prevention

When it happens

Trigger: install-bundle when `dsh plugin --profile codewhale add <app_source_path>` exits non-zero: pnpm registry unreachable, the app source path unreadable, the `codewhale` profile directory not writable, a pnpm store lock conflict, or dsh's plugin subsystem rejecting the package.

Common situations: Offline or proxied networks blocking the npm registry; `$DSH_HOME/profiles/codewhale` owned by another user (created under sudo); concurrent pnpm processes holding the store lock; corporate registries requiring auth that pnpm lacks.

Related errors


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