Hmbown/CodeWhale · error

{} does not declare dsh.bundle.patch; cannot link it as a pr

Error message

{} does not declare dsh.bundle.patch; cannot link it as a profile bundle

What it means

After locating the launcher package root, `app_bundle_source` reads `<root>/node_modules/@deepseek-ai/dsh-<app>/package.json` and requires it to declare both `"bundle"` and `"patch"` (the `dsh.bundle.patch` capability). This error means the app package exists but its manifest does not declare that capability, so Codewhale cannot link it as a profile bundle — the installed dsh release ships app packages that are not bundle-capable (different version, changed layout, or stripped build).

Source

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

        && std::fs::read_to_string(dir.join("package.json"))
            .ok()
            .is_some_and(|text| text.contains("\"@deepseek-ai/dsh\""))
}

/// The shipped app bundle directory inside the installed launcher, if it
/// declares `dsh.bundle.patch`.
pub(crate) fn app_bundle_source(binary: &Path, app: DshAppBundle) -> Result<PathBuf> {
    let root = launcher_package_root(binary).ok_or_else(|| {
        anyhow::anyhow!(
            "cannot locate the installed dsh package root from {}",
            binary.display()
        )
    })?;
    let dir = root.join("node_modules").join(app.package_name());
    let manifest = std::fs::read_to_string(dir.join("package.json"))
        .with_context(|| format!("read {}", dir.join("package.json").display()))?;
    if !manifest.contains("\"bundle\"") || !manifest.contains("\"patch\"") {
        anyhow::bail!(
            "{} does not declare dsh.bundle.patch; cannot link it as a profile bundle",
            dir.display()
        );
    }
    Ok(dir)
}

pub(crate) fn bundle_version(codewhale_version: &str, patch_sha256: &str) -> String {
    format!(
        "{codewhale_version}+dsh.{}",
        &patch_sha256[..12.min(patch_sha256.len())]
    )
}

/// Files the bundle package consists of (all Codewhale-owned).
pub(crate) fn render_bundle_files(
    codewhale_version: &str,
    overlay_text: &str,

View on GitHub (pinned to 8880682c63)

Solutions

  1. Reinstall dsh cleanly so optional app packages are present: `npm i -g @deepseek-ai/dsh@latest`
  2. Inspect `<dsh package root>/node_modules/@deepseek-ai/dsh-web/package.json` (and dsh-headless) and confirm they contain the bundle and patch keys
  3. If the latest dsh still fails, this Codewhale build and that dsh release are out of step — update Codewhale or pin dsh to the release named by `codewhale integrations dsh status`
  4. Avoid npm flags that skip optional dependencies for this global install
Defensive patterns

Strategy: validation

Validate before calling

let app_dir = root.join("node_modules").join(app.package_name());
let manifest = std::fs::read_to_string(app_dir.join("package.json"))?;
if !(manifest.contains("\"bundle\"") && manifest.contains("\"patch\"")) {
    eprintln!("{} is not bundle-capable; update dsh: npm i -g @deepseek-ai/dsh@latest", app_dir.display());
    return Ok(());
}

Type guard

fn app_bundle_capable(root: &std::path::Path, app: dsh::DshAppBundle) -> bool {
    std::fs::read_to_string(
        root.join("node_modules").join(app.package_name()).join("package.json"),
    )
    .is_ok_and(|m| m.contains("\"bundle\"") && m.contains("\"patch\""))
}

Prevention

When it happens

Trigger: install-bundle with `--app web` or `--app headless` on a dsh release whose bundled app packages lack the bundle/patch manifest keys — older releases that did not ship app bundles, newer releases that moved or renamed them, or installs where optional dependencies were skipped (`npm i --omit=optional`).

Common situations: dsh releases before app bundles existed; npm installs with --omit=optional or --no-optional pruning app packages; registry mirrors serving a stale or trimmed @deepseek-ai scope; partial global installs after an interrupted upgrade.

Related errors


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