Hmbown/CodeWhale · error · anyhow::Error

allowlisted read-only executable {program:?} was not found a

Error message

allowlisted read-only executable {program:?} was not found at a canonical path outside the workspace

What it means

Terminal error from the allowlisted read-only executable resolver: every candidate binary matching the searched names was either missing, non-executable, or canonicalized to a path inside the workspace. The resolver walks trusted directories looking for a canonical path strictly outside the workspace root; failure means no safe external binary was found for the allowlisted program.

Source

Thrown at crates/tui/src/tools/shell.rs:3925

        for name in &names {
            let candidate = directory.join(name);
            if !candidate.is_file() {
                continue;
            }
            #[cfg(unix)]
            {
                use std::os::unix::fs::PermissionsExt as _;
                if candidate.metadata()?.permissions().mode() & 0o111 == 0 {
                    continue;
                }
            }
            let resolved = candidate.canonicalize()?;
            if resolved.is_absolute() && !resolved.starts_with(&workspace) {
                return Ok(resolved);
            }
        }
    }
    Err(anyhow!(
        "allowlisted read-only executable {program:?} was not found at a canonical path outside the workspace"
    ))
}

fn remove_readonly_redirect_env(cmd: &mut Command, env: &HashMap<String, String>) {
    if env.get(READONLY_ENV_MARKER).map(String::as_str) != Some("1") {
        return;
    }
    cmd.env_remove(READONLY_ENV_MARKER);
    let removals = cmd
        .get_envs()
        .filter_map(|(key, _)| {
            let upper = key.to_string_lossy().to_ascii_uppercase();
            let guarded = upper.starts_with("GIT_")
                || upper.starts_with("GH_")
                || upper.starts_with("GITHUB_");
            let safe = matches!(
                upper.as_str(),

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Install the {program} binary in a standard system directory (e.g. /usr/local/bin) with the executable bit set
  2. Verify the binary is not only present inside the workspace — workspace-local copies are deliberately rejected
  3. Check PATH-adjacent trusted directories the resolver scans actually contain the program
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/tui/src/tools/shell.rs:3925 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/2fcaad2a8b75de58. Report an issue: GitHub.