Hmbown/CodeWhale · error

plugin path {} escapes plugins directory {}

Error message

plugin path {} escapes plugins directory {}

What it means

ensure_target_within_plugins_dir canonicalized both paths and found the plugin's resolved target escapes the resolved plugins root — typically via a symlinked directory. This mirrors discovery's containment rule so a planted link cannot make update/uninstall operate outside the plugins dir.

Source

Thrown at crates/tui/src/plugins/install/place.rs:144

    Ok(user_plugins_dir.join(name))
}

/// The resolved bundle must be a direct child of the resolved plugins root,
/// matching discovery's fail-closed containment rule.
pub(super) fn ensure_target_within_plugins_dir(
    target: &Path,
    user_plugins_dir: &Path,
) -> Result<()> {
    let root = fs::canonicalize(user_plugins_dir).with_context(|| {
        format!(
            "failed to resolve plugins directory {}",
            user_plugins_dir.display()
        )
    })?;
    let target = fs::canonicalize(target)
        .with_context(|| format!("failed to resolve {}", target.display()))?;
    if target.parent() != Some(root.as_path()) {
        bail!(
            "plugin path {} escapes plugins directory {}",
            target.display(),
            root.display()
        );
    }
    Ok(())
}

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Remove the symlink and restore a real directory under the plugins root
  2. Retry the operation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/plugins/install/place.rs:144 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/575bf929403eae53. Report an issue: GitHub.