{"record":{"id":"c3854ca3baab7944","repo":"Hmbown/CodeWhale","slug":"dsh-plugin-remove-bundle-package-name-failed","errorCode":null,"errorMessage":"dsh plugin remove {BUNDLE_PACKAGE_NAME} failed: {}","messagePattern":"dsh plugin remove (.+?) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/bundle.rs","lineNumber":488,"sourceCode":"    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    )?;\n    if !outcome.success {\n        anyhow::bail!(\n            \"dsh plugin remove {BUNDLE_PACKAGE_NAME} failed: {}\",\n            outcome.output_excerpt\n        );\n    }\n    Ok(outcome)\n}\n\n/// Read the dedicated profile's `dsh.profile.bundles` (DSH-owned manifest,\n/// read-only) so status can prove the bundle is actually composed.\npub(crate) fn profile_bundles(profile_dir: &Path) -> Option<Vec<String>> {\n    let text = std::fs::read_to_string(profile_dir.join(\"package.json\")).ok()?;\n    let json: serde_json::Value = serde_json::from_str(&text).ok()?;\n    Some(\n        json.get(\"dsh\")?\n            .get(\"profile\")?\n            .get(\"bundles\")?\n            .as_array()?\n            .iter()","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/integrations/dsh/bundle.rs#L470-L506","documentation":"remove_from_profile runs `dsh plugin remove <BUNDLE_PACKAGE_NAME>` to unregister the Codewhale bundle from the profile and bails if dsh exits non-success, echoing dsh's output excerpt. This keeps the caller from believing the bundle was unlinked when dsh actually refused or failed.","triggerScenarios":"Calling remove_from_profile (via remove-bundle) when the bundle plugin is not present in the profile, dsh errors, or the profile is locked/inaccessible.","commonSituations":"Running remove-bundle when the bundle was already removed manually with `dsh plugin remove`; a corrupted dsh profile; permission problems in the dsh home directory.","solutions":["Read the excerpt: if the plugin is already gone, treat removal as done and clean up remaining files","Run `dsh plugin list` to see what is actually registered in BUNDLE_PROFILE","Fix any dsh-reported permission/lock issue and retry","Repair or reinstall dsh if the CLI itself is failing"],"exampleFix":"// before\n// remove fails: dsh plugin remove codewhale-bundle failed: not found\n// after\nif dsh plugin list | grep -q codewhale-bundle; then codewhale dsh remove-bundle; fi","handlingStrategy":"try-catch","validationCode":"let out = std::process::Command::new(\"dsh\").args([\"plugin\", \"list\"]).output()?;\nlet registered = String::from_utf8_lossy(&out.stdout).contains(\"codewhale-bundle\");\nif !registered { eprintln!(\"bundle already absent; nothing to remove\"); }","typeGuard":"fn bundle_installed(dsh_list_output: &str, bundle_name: &str) -> bool {\n    dsh_list_output.contains(bundle_name)\n}","tryCatchPattern":"match remove_from_profile(...) {\n    Err(e) if e.to_string().contains(\"plugin remove\") => {\n        // treat already-absent as success after verifying via plugin list\n        verify_bundle_absent()?;\n    }\n    r => r?,\n}","preventionTips":["Check plugin list before removal to detect already-removed state","Keep a single code path (remove-bundle) for uninstalling so state stays consistent","Fix dsh home permissions before lifecycle operations"],"tags":["external-command","dsh-plugin","cleanup"],"backgroundTag":"command-not-found","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"}