{"record":{"id":"8b529f37c5a863f9","repo":"Hmbown/CodeWhale","slug":"dsh-plugin-add-bundle-package-name-failed-seco","errorCode":null,"errorMessage":"dsh plugin add {BUNDLE_PACKAGE_NAME} failed: {second_excerpt}","messagePattern":"dsh plugin add (.+?) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/bundle.rs","lineNumber":350,"sourceCode":"    let app_source_str = app_source.display().to_string();\n    let first = run_dsh_plugin(runner, binary, BUNDLE_PROFILE, &[\"add\", &app_source_str])?;\n    let first_ok = first.success;\n    let first_excerpt = first.output_excerpt.clone();\n    outcomes.push(first);\n    if !first_ok {\n        anyhow::bail!(\n            \"dsh plugin add {} failed: {}\",\n            app.package_name(),\n            first_excerpt\n        );\n    }\n    let bundle_str = bundle_dir.display().to_string();\n    let second = run_dsh_plugin(runner, binary, BUNDLE_PROFILE, &[\"add\", &bundle_str])?;\n    let second_ok = second.success;\n    let second_excerpt = second.output_excerpt.clone();\n    outcomes.push(second);\n    if !second_ok {\n        anyhow::bail!(\"dsh plugin add {BUNDLE_PACKAGE_NAME} failed: {second_excerpt}\");\n    }\n    Ok((app_source, outcomes))\n}\n\npub(crate) fn remove_from_profile(\n    runner: &dyn DshRunner,\n    detection: &DshDetection,\n) -> Result<PluginCommandOutcome> {\n    let binary = detection\n        .binary\n        .as_ref()\n        .ok_or_else(|| anyhow::anyhow!(\"dsh binary is unknown\"))?;\n    let outcome = run_dsh_plugin(\n        runner,\n        binary,\n        BUNDLE_PROFILE,\n        &[\"remove\", BUNDLE_PACKAGE_NAME],\n    )?;","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/dsh/bundle.rs#L332-L368","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry `codewhale integrations dsh install-bundle` — both adds are re-runnable and dsh plugin add is idempotent for an already-linked app bundle","Verify `$CODEWHALE_HOME/integrations/dsh/bundle/package.json` exists and is valid JSON before retrying","Read the output_excerpt for pnpm's own error; fix registry/lock/permission issues it names","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// guard the Codewhale-owned bundle dir before the second add can run\nlet manifest = paths.bundle_dir.join(\"package.json\");\nif !manifest.is_file() {\n    eprintln!(\"bundle dir incomplete; re-run install-bundle from a clean state\");\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"// on failure the profile holds the app bundle but not the Codewhale bundle:\n// log the half-composed state, then re-run install_into_profile — both adds\n// are idempotent and will converge the profile to fully composed.","preventionTips":["Do not touch $CODEWHALE_HOME/integrations/dsh/bundle/ while install-bundle runs","Retry install-bundle wholesale rather than hand-fixing the profile — the two adds converge","Free disk and release pnpm store locks before retrying"],"tags":["rust","dsh","pnpm","plugin","partial-install"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}