Hmbown/CodeWhale · error

cannot install a bundle from inside the user plugins directo

Error message

cannot install a bundle from inside the user plugins directory {}; it is already in place

What it means

stage_local_copy canonicalized the source and found it lies inside the user plugins directory itself. Copying a bundle onto itself would nest or duplicate it, so the guard fires and tells the user the bundle is already in place.

Source

Thrown at crates/tui/src/plugins/install/stage.rs:108

    max_size: u64,
) -> Result<StagedPlugin> {
    // Validate the source first; this also rejects symlinked roots/manifests.
    let manifest_path =
        crate::plugins::agent_plugin::resolve_manifest_path(source).ok_or_else(|| {
            anyhow::anyhow!(
                "source is not a valid plugin bundle: no plugin.json, kimi.plugin.json, or plugin.toml"
            )
        })?;
    PluginManifest::validate_from_path(&manifest_path)
        .map_err(|error| anyhow::anyhow!("source is not a valid plugin bundle: {error}"))?;
    let canonical_source = source
        .canonicalize()
        .with_context(|| format!("failed to resolve {}", source.display()))?;
    if let Ok(canonical_plugins) = user_plugins_dir.canonicalize()
        && (canonical_source == canonical_plugins
            || canonical_source.starts_with(&canonical_plugins))
    {
        bail!(
            "cannot install a bundle from inside the user plugins directory {}; \
             it is already in place",
            canonical_plugins.display()
        );
    }

    let staged_path = fresh_staging_dir(user_plugins_dir)?;
    let result = (|| -> Result<StagedPlugin> {
        let mut budget = CopyBudget::default();
        copy_bundle_regular_files(&canonical_source, &staged_path, max_size, &mut budget)?;
        let (name, content_hash) = validate_staged(&staged_path)?;
        Ok(StagedPlugin {
            name,
            staged_path: staged_path.clone(),
            content_hash,
        })
    })();
    if result.is_err() {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Skip installation — the bundle is already installed
  2. Or move the source outside the plugins directory first
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/tui/src/plugins/install/stage.rs:108 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/ecbbfe8ce9bb6213. Report an issue: GitHub.