Hmbown/CodeWhale · error

refusing to uninstall the {} bundle `{selector}`; remove it

Error message

refusing to uninstall the {} bundle `{selector}`; remove it from its own root

What it means

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.

Source

Thrown at crates/tui/src/plugins/mutation.rs:208

            content_hash: Some(installed.content_hash),
            installed_content_hash: Some(installed.installed_content_hash),
            outcome: PluginMutationOutcome::Updated,
        },
        PluginUpdateResult::NeedsApproval(host) => blocked(host, true),
        PluginUpdateResult::NetworkDenied(host) => blocked(host, false),
    })
}

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,

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Remove the bundle from its own root as the message directs
  2. User-scope bundles can be uninstalled with /plugin uninstall
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/tui/src/plugins/mutation.rs:208 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/79c206e7a0db7b13. Report an issue: GitHub.