{"record":{"id":"79c206e7a0db7b13","repo":"Hmbown/CodeWhale","slug":"refusing-to-uninstall-the-bundle-selector","errorCode":null,"errorMessage":"refusing to uninstall the {} bundle `{selector}`; remove it from its own root","messagePattern":"refusing to uninstall the (.+?) bundle `(.+?)`; remove it from its own root","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/plugins/mutation.rs","lineNumber":208,"sourceCode":"            content_hash: Some(installed.content_hash),\n            installed_content_hash: Some(installed.installed_content_hash),\n            outcome: PluginMutationOutcome::Updated,\n        },\n        PluginUpdateResult::NeedsApproval(host) => blocked(host, true),\n        PluginUpdateResult::NetworkDenied(host) => blocked(host, false),\n    })\n}\n\nfn uninstall_plugin(\n    selector: &str,\n    registry: &mut PluginRegistry,\n) -> Result<PluginMutationReceipt> {\n    let plugin = registry\n        .get(selector)\n        .with_context(|| format!(\"Plugin bundle `{selector}` was not found\"))?\n        .clone();\n    if plugin.scope != PluginScope::User {\n        bail!(\n            \"refusing to uninstall the {} bundle `{selector}`; remove it from its own root\",\n            plugin.scope.as_str()\n        );\n    }\n    if plugin.enabled {\n        bail!(\"plugin `{selector}` is enabled; disable it first with /plugin disable {selector}\");\n    }\n    let plugins_dir = user_plugins_dir(registry)?;\n    install::uninstall(plugin.name(), &plugins_dir)?;\n    registry\n        .prune_state_entry(selector)\n        .map_err(anyhow::Error::msg)?;\n    Ok(PluginMutationReceipt {\n        name: plugin.name().to_string(),\n        path: None,\n        content_hash: None,\n        installed_content_hash: None,\n        outcome: PluginMutationOutcome::Uninstalled,","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/plugins/mutation.rs#L190-L226","documentation":"uninstall_plugin scope guard: the selected bundle is not a user-scope /plugin install (scope shown in the placeholder), so the mutation surface refuses to delete it. Non-user bundles are removed by editing whatever root ships them, keeping this path from touching files it does not own.","triggerScenarios":"Thrown at crates/tui/src/plugins/mutation.rs:208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the bundle from its own root as the message directs","User-scope bundles can be uninstalled with /plugin uninstall"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}