{"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":"exception","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/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/plugins/mutation.rs#L190-L226","documentation":"`uninstall_plugin` refuses to remove any bundle whose scope is not `PluginScope::User`; such bundles are owned by their own root (app install, project, etc.) and must be removed there. The message names the scope and points at the owning root.","triggerScenarios":"Calling `/plugin uninstall <selector>` (through `execute` → `uninstall_plugin`) where `registry.get(selector).scope != PluginScope::User` — e.g. uninstalling a built-in or project-scoped bundle.","commonSituations":"Trying to remove a plugin that shipped with the application; trying to delete a repo-managed plugin via the plugin command instead of editing the repo.","solutions":["Remove the bundle at its owning root (uninstall/upgrade the app, or delete it from the project config/repo)","If it is user-installed but the scope is wrong, reinstall it with `/plugin install` so it is registered at user scope","Confirm the scope via `/plugin list` before attempting removal"],"exampleFix":"// before\n/plugin uninstall builtin-lint   # not user scope\n// after: remove at its own root\n# built-ins go away with an app upgrade/reinstall\n// project bundle: remove from the repo's plugin manifest","handlingStrategy":"validation","validationCode":"let plugin = registry.get(selector)?;\nif plugin.scope != PluginScope::User {\n    eprintln!(\"{} is {:?}-scoped; remove it at its own root\", selector, plugin.scope);\n    return;\n}","typeGuard":null,"tryCatchPattern":"match uninstall_plugin(selector, registry) {\n    Err(e) if e.to_string().contains(\"refusing to uninstall\") => {\n        eprintln!(\"owned by another scope; remove it there (app or project)\");\n    }\n    other => other?,\n}","preventionTips":["Uninstall only user-scope plugins via /plugin uninstall","Track where built-in/project bundles come from","Confirm scope via /plugin list in automation before removal"],"tags":["plugins","uninstall","scope"],"backgroundTag":"unsupported-operation","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"}