{"record":{"id":"44c3d621a4d672e7","repo":"Hmbown/CodeWhale","slug":"does-not-declare-dsh-bundle-patch-cannot-link","errorCode":null,"errorMessage":"{} does not declare dsh.bundle.patch; cannot link it as a profile bundle","messagePattern":"(.+?) does not declare dsh\\.bundle\\.patch; cannot link it as a profile bundle","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/bundle.rs","lineNumber":190,"sourceCode":"        && std::fs::read_to_string(dir.join(\"package.json\"))\n            .ok()\n            .is_some_and(|text| text.contains(\"\\\"@deepseek-ai/dsh\\\"\"))\n}\n\n/// The shipped app bundle directory inside the installed launcher, if it\n/// declares `dsh.bundle.patch`.\npub(crate) fn app_bundle_source(binary: &Path, app: DshAppBundle) -> Result<PathBuf> {\n    let root = launcher_package_root(binary).ok_or_else(|| {\n        anyhow::anyhow!(\n            \"cannot locate the installed dsh package root from {}\",\n            binary.display()\n        )\n    })?;\n    let dir = root.join(\"node_modules\").join(app.package_name());\n    let manifest = std::fs::read_to_string(dir.join(\"package.json\"))\n        .with_context(|| format!(\"read {}\", dir.join(\"package.json\").display()))?;\n    if !manifest.contains(\"\\\"bundle\\\"\") || !manifest.contains(\"\\\"patch\\\"\") {\n        anyhow::bail!(\n            \"{} does not declare dsh.bundle.patch; cannot link it as a profile bundle\",\n            dir.display()\n        );\n    }\n    Ok(dir)\n}\n\npub(crate) fn bundle_version(codewhale_version: &str, patch_sha256: &str) -> String {\n    format!(\n        \"{codewhale_version}+dsh.{}\",\n        &patch_sha256[..12.min(patch_sha256.len())]\n    )\n}\n\n/// Files the bundle package consists of (all Codewhale-owned).\npub(crate) fn render_bundle_files(\n    codewhale_version: &str,\n    overlay_text: &str,","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/dsh/bundle.rs#L172-L208","documentation":"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).","triggerScenarios":"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`).","commonSituations":"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.","solutions":["Reinstall dsh cleanly so optional app packages are present: `npm i -g @deepseek-ai/dsh@latest`","Inspect `<dsh package root>/node_modules/@deepseek-ai/dsh-web/package.json` (and dsh-headless) and confirm they contain the bundle and patch keys","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`","Avoid npm flags that skip optional dependencies for this global install"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let app_dir = root.join(\"node_modules\").join(app.package_name());\nlet manifest = std::fs::read_to_string(app_dir.join(\"package.json\"))?;\nif !(manifest.contains(\"\\\"bundle\\\"\") && manifest.contains(\"\\\"patch\\\"\")) {\n    eprintln!(\"{} is not bundle-capable; update dsh: npm i -g @deepseek-ai/dsh@latest\", app_dir.display());\n    return Ok(());\n}","typeGuard":"fn app_bundle_capable(root: &std::path::Path, app: dsh::DshAppBundle) -> bool {\n    std::fs::read_to_string(\n        root.join(\"node_modules\").join(app.package_name()).join(\"package.json\"),\n    )\n    .is_ok_and(|m| m.contains(\"\\\"bundle\\\"\") && m.contains(\"\\\"patch\\\"\"))\n}","tryCatchPattern":null,"preventionTips":["Never install dsh with --omit=optional if you plan to use bundle features","Reinstall dsh when its version and Codewhale's verified release drift apart","Inspect the app package manifest when bundle install fails at the source-resolution step"],"tags":["rust","dsh","npm","manifest","compatibility"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}