openai/codex · error · anyhow::Error

helper not found next to current executable or under

Error message

helper not found next to current executable or under {RESOURCES_DIRNAME}: {}

What it means

The sandbox helper executable (e.g., the elevated runner) was not found next to the current executable nor under the bundled resources directory, so there is no source from which to materialize the helper. The binary distribution is missing embedded helper files or was assembled incorrectly.

Solutions

  1. Reinstall or rebuild the distribution so the helper exe ships next to the main binary or under the resources dir
  2. In dev builds, ensure cargo/bazel placed the helper binary in the expected sibling location
  3. Fall back to PATH lookup for the helper if bundling is unavailable
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at codex-rs/windows-sandbox-rs/src/helper_materialization.rs:187 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/8b79b70faec0c041. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/windows-sandbox-rs/src/helper_materialization.rs:187

}

fn cached_helper_path(cache_key: &str) -> Option<PathBuf> {
    let cache = HELPER_PATH_CACHE.get_or_init(|| Mutex::new(HashMap::new()));
    let guard = cache.lock().ok()?;
    guard.get(cache_key).cloned()
}

fn store_helper_path(cache_key: String, path: PathBuf) {
    let cache = HELPER_PATH_CACHE.get_or_init(|| Mutex::new(HashMap::new()));
    if let Ok(mut guard) = cache.lock() {
        guard.insert(cache_key, path);
    }
}

fn sibling_source_path(kind: HelperExecutable) -> Result<PathBuf> {
    let exe = std::env::current_exe().context("resolve current executable for helper lookup")?;
    bundled_executable_path_for_exe(&exe, kind.file_name()).ok_or_else(|| {
        anyhow!(
            "helper not found next to current executable or under {RESOURCES_DIRNAME}: {}",
            exe.display()
        )
    })
}

pub(crate) fn bundled_executable_path_for_exe(exe: &Path, file_name: &str) -> Option<PathBuf> {
    let find = |exe: &Path| {
        let dir = exe.parent()?;
        let direct_candidate = dir.join(file_name);
        if direct_candidate.is_file() {
            return Some(direct_candidate);
        }

        if dir.file_name() == Some(OsStr::new(BIN_DIRNAME))
            && let Some(package_dir) = dir.parent()
        {
            let package_resource_candidate = package_dir.join(RESOURCES_DIRNAME).join(file_name);

View on GitHub (pinned to 339751715c)