{"record":{"id":"a4a8cf064763f64c","repo":"Hmbown/CodeWhale","slug":"dsh-plugin-path-not-available-reason-a4a8cf","errorCode":null,"errorMessage":"DSH plugin path not available: {reason}","messagePattern":"DSH plugin path not available: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/mod.rs","lineNumber":779,"sourceCode":"    let status = command\n        .status()\n        .with_context(|| format!(\"launch {}\", spec.binary.display()))?;\n    Ok(status.code().unwrap_or(1))\n}\n\n/// Install the Codewhale bundle into the dedicated `codewhale` DSH profile via\n/// the documented `dsh plugin --profile codewhale add <path>` (pnpm).\npub(crate) fn install_bundle(\n    paths: &DshPaths,\n    detection: &DshDetection,\n    runner: &dyn DshRunner,\n    availability: &BundleAvailability,\n    app: DshAppBundle,\n) -> Result<DshBundleRecord> {\n    let pnpm_version = match availability {\n        BundleAvailability::Available { pnpm_version } => pnpm_version.clone(),\n        BundleAvailability::NotAvailable { reason } => {\n            anyhow::bail!(\"DSH plugin path not available: {reason}\")\n        }\n    };\n    let mut doc = DshReceiptDocument::load(&paths.receipt)?;\n    let Some(mut record) = doc.current.take() else {\n        anyhow::bail!(\"DSH is not connected; run `{CLI_COMMAND} connect` first\");\n    };\n    if record.bundle.is_some() {\n        anyhow::bail!(\"bundle already installed; use `{CLI_COMMAND} update` or `remove-bundle`\");\n    }\n    let overlay_text = std::fs::read_to_string(&paths.overlay)\n        .with_context(|| format!(\"read {}\", paths.overlay.display()))?;\n    if sha256_hex(overlay_text.as_bytes()) != record.overlay_sha256 {\n        anyhow::bail!(\"overlay is stale; run `{CLI_COMMAND} update` before install-bundle\");\n    }\n    // install-bundle defaults the palette on; `update --skin false` is the\n    // off switch. `connect --skin` records the same decision for a later update.\n    let skin = true;\n    // The ocean scene follows the recorded decision (default on).","sourceCodeStart":761,"sourceCodeEnd":797,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/integrations/dsh/mod.rs#L761-L797","documentation":"install_bundle checks the precomputed BundleAvailability before doing any work. When the plugin path (the pnpm-managed location where the Codewhale bundle would be added via `dsh plugin --profile codewhale add`) is not usable — pnpm missing, wrong version, unwritable path — it aborts with this error carrying the availability `reason`.","triggerScenarios":"Calling `codewhale dsh install-bundle` (or update paths that reuse install_bundle) while the earlier availability probe returned BundleAvailability::NotAvailable { reason } — e.g. pnpm is not installed or its version is below the required minimum.","commonSituations":"Node/pnpm toolchain not installed; pnpm installed only via corepack and not enabled; restricted CI container lacking pnpm; permissions on the dsh plugin directory.","solutions":["Install or enable pnpm (e.g. `corepack enable pnpm` or `npm i -g pnpm`) and confirm `pnpm --version` meets the requirement stated in the error's reason.","Fix the path/permission issue named in the `{reason}` and retry `codewhale dsh install-bundle`.","Verify the dsh plugin directory exists and is writable by the current user."],"exampleFix":"// before\ncodewhale dsh install-bundle\nError: DSH plugin path not available: pnpm not found on PATH\n\n// after\ncorepack enable pnpm\npnpm --version\ncodewhale dsh install-bundle","handlingStrategy":"validation","validationCode":"if !matches!(availability, BundleAvailability::Available { .. }) {\n    if let BundleAvailability::NotAvailable { reason } = availability {\n        eprintln!(\"fix plugin path first: {reason}\");\n    }\n    return Err(...);\n}","typeGuard":"fn pnpm_available(a: &BundleAvailability) -> Option<&str> {\n    match a { BundleAvailability::Available { pnpm_version } => Some(pnpm_version), _ => None }\n}","tryCatchPattern":"match install_bundle(&paths, &detection, runner, &availability, app) {\n    Err(e) if e.to_string().starts_with(\"DSH plugin path not available\") => {\n        install_pnpm()?;\n        // recompute availability and retry\n    }\n    other => other?,\n}","preventionTips":["Install pnpm (corepack enable) as part of environment setup.","Check `pnpm --version` in preflight scripts.","Ensure the dsh plugin directory is writable by the runtime user."],"tags":["dsh","bundle","pnpm","prerequisite"],"backgroundTag":"missing-dependency","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}