Hmbown/CodeWhale · error · anyhow::Error

refusing to remove skill outside CodeWhale-owned roots

Error message

refusing to remove skill outside CodeWhale-owned roots

What it means

Raised in remove_skill when the audited skill's root is not a writable CodeWhale-owned root. Removal deletes directories, so it is restricted to skill roots the tool owns; skills merely discovered from external locations cannot be deleted through this path.

Source

Thrown at crates/tui/src/skills/mutation.rs:942

            action: SkillActionKind::Update,
            name: skill_id.canonical_name,
            scope,
            safe_target_path: safe_display_path(&path, Some(ctx.workspace), ctx.home),
            before_digest: before,
            after_digest: None,
            outcome: SkillMutationOutcome::NetworkDenied(host),
        }),
    }
}

fn remove_skill(
    skill_id: AuditedSkillId,
    expected_digest: Option<String>,
    ctx: &MutationContext<'_>,
) -> Result<SkillMutationReceipt> {
    let (skill, path) = find_audited_skill(ctx, &skill_id)?;
    if !skill.root.is_writable_owned() {
        bail!("refusing to remove skill outside CodeWhale-owned roots");
    }
    if skill.source_kind != SkillSourceKind::CodeWhaleManaged {
        bail!("only CodeWhale managed skills can be removed");
    }
    let skills_dir = validate_owned_skill_path(ctx, &skill, &path)?;
    let before = verify_expected_digest(&path, expected_digest.as_deref())?;
    let scope = match skill.root.kind {
        SkillRootKind::CodeWhaleProject => SkillScope::Project,
        SkillRootKind::CodeWhaleGlobal => SkillScope::Global,
        _ => SkillScope::Logical,
    };
    let package_name = on_disk_package_name(&skill_id)?;
    validate_owned_skill_path(ctx, &skill, &path)?;
    install::uninstall(package_name, &skills_dir)?;
    Ok(SkillMutationReceipt {
        action: SkillActionKind::Remove,
        name: skill_id.canonical_name,
        scope,

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Remove the skill using its own installer or by deleting the directory manually
  2. Only call remove on skills located in CodeWhale-owned scopes
  3. Confirm the skill id targets the owned copy if both owned and external copies exist
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/skills/mutation.rs:942 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/41702edce566e18d. Report an issue: GitHub.