Hmbown/CodeWhale · error

dsh plugin add {BUNDLE_PACKAGE_NAME} failed: {second_excerpt

Error message

dsh plugin add {BUNDLE_PACKAGE_NAME} failed: {second_excerpt}

What it means

The second of the two `dsh plugin --profile codewhale add` commands adds the Codewhale-owned bundle package (`BUNDLE_PACKAGE_NAME`) so its rows patch after the app bundle's. This error fires when that second add fails after the first succeeded — the profile is then half-composed: the app bundle is linked but the Codewhale patch bundle is not, so the dedicated profile does not yet carry the pinned identity.

Source

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

    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,
    detection: &DshDetection,
) -> Result<PluginCommandOutcome> {
    let binary = detection
        .binary
        .as_ref()
        .ok_or_else(|| anyhow::anyhow!("dsh binary is unknown"))?;
    let outcome = run_dsh_plugin(
        runner,
        binary,
        BUNDLE_PROFILE,
        &["remove", BUNDLE_PACKAGE_NAME],
    )?;

View on GitHub (pinned to 8880682c63)

Solutions

  1. Retry `codewhale integrations dsh install-bundle` — both adds are re-runnable and dsh plugin add is idempotent for an already-linked app bundle
  2. Verify `$CODEWHALE_HOME/integrations/dsh/bundle/package.json` exists and is valid JSON before retrying
  3. Read the output_excerpt for pnpm's own error; fix registry/lock/permission issues it names
  4. If it keeps failing, remove the half-linked app bundle (`remove-bundle` after re-completing install, or `dsh plugin --profile codewhale remove <app-package>`) and start over
Defensive patterns

Strategy: retry

Validate before calling

// guard the Codewhale-owned bundle dir before the second add can run
let manifest = paths.bundle_dir.join("package.json");
if !manifest.is_file() {
    eprintln!("bundle dir incomplete; re-run install-bundle from a clean state");
    return Ok(());
}

Try / catch

// on failure the profile holds the app bundle but not the Codewhale bundle:
// log the half-composed state, then re-run install_into_profile — both adds
// are idempotent and will converge the profile to fully composed.

Prevention

When it happens

Trigger: install-bundle where the app-bundle add succeeds but the Codewhale bundle add fails: the Codewhale-owned `bundle_dir` was moved or deleted between planning and add, its package.json is malformed, or pnpm fails transiently (network, store lock) on the second invocation.

Common situations: Another process cleaning `$CODEWHALE_HOME/integrations/dsh/bundle/` mid-install; interrupted installs leaving a locked pnpm store; disk-full during package linking; permission changes between the two adds.

Related errors


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