Hmbown/CodeWhale · error
plugin ` ` is enabled; disable it first with /plugin disable
Error message
plugin `{selector}` is enabled; disable it first with /plugin disable {selector} What it means
Before uninstalling, `uninstall_plugin` requires the bundle to be disabled. If `plugin.enabled` is true it bails and tells the user the exact `/plugin disable <selector>` command to run first. This prevents deleting a bundle that is actively loaded.
Solutions
- Run `/plugin disable <selector>` first, then `/plugin uninstall <selector>`
- In scripts, call the disable mutation before the uninstall mutation and check its receipt
Example fix
// before /plugin uninstall myplugin # enabled -> refuse // after /plugin disable myplugin /plugin uninstall myplugin
Defensive patterns
Strategy: validation
Validate before calling
let plugin = registry.get(selector)?;
if plugin.enabled {
eprintln!("disable {} before uninstalling: /plugin disable {}", selector, selector);
return;
} Try / catch
match uninstall_plugin(selector, registry) {
Err(e) if e.to_string().contains("disable it first") => {
execute_disable(selector)?; // /plugin disable <selector>
uninstall_plugin(selector, registry)?;
}
other => other?,
} Prevention
- Always disable before uninstall in scripts
- Wrap uninstall in a disable-then-uninstall helper
- Surface enabled state in any uninstall UI/confirmation
When it happens
Trigger: Calling `/plugin uninstall <selector>` on a user-scope bundle while it is still enabled in the registry.
Common situations: Uninstalling during cleanup without realizing the plugin is active; scripted uninstall loops that do not disable first.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- plugin ' ' is not installed at
- refusing to uninstall the
- A cancelled Operation cannot be edited.
- active plugin registry is missing its pre-dotenv…
- atomic built-in snapshot publication is unsupported on this…
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/d1ee8daf019ad9f8.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/plugins/mutation.rs:214
})
}
fn uninstall_plugin(
selector: &str,
registry: &mut PluginRegistry,
) -> Result<PluginMutationReceipt> {
let plugin = registry
.get(selector)
.with_context(|| format!("Plugin bundle `{selector}` was not found"))?
.clone();
if plugin.scope != PluginScope::User {
bail!(
"refusing to uninstall the {} bundle `{selector}`; remove it from its own root",
plugin.scope.as_str()
);
}
if plugin.enabled {
bail!("plugin `{selector}` is enabled; disable it first with /plugin disable {selector}");
}
let plugins_dir = user_plugins_dir(registry)?;
install::uninstall(plugin.name(), &plugins_dir)?;
registry
.prune_state_entry(selector)
.map_err(anyhow::Error::msg)?;
Ok(PluginMutationReceipt {
name: plugin.name().to_string(),
path: None,
content_hash: None,
installed_content_hash: None,
outcome: PluginMutationOutcome::Uninstalled,
})
}
fn blocked(host: String, needs_approval: bool) -> PluginMutationReceipt {
PluginMutationReceipt {
name: String::new(),View on GitHub (pinned to 73e0f67d83)