openai/codex · error · anyhow::Error
missing required {COMMAND_CWD_FLAG}
Error message
missing required {COMMAND_CWD_FLAG} What it means
Error "missing required {COMMAND_CWD_FLAG}" thrown in openai/codex.
Source
Thrown at codex-rs/windows-sandbox-rs/src/wrapper.rs:293
write_roots_override =
Some(json_flag_value(next_flag_value(&mut args, &arg)?, &arg)?);
}
"--" => {
command = Some(args.collect::<Vec<_>>());
break;
}
_ => bail!("unexpected windows sandbox wrapper argument: {arg}"),
}
}
let codex_home = codex_home.ok_or_else(|| anyhow!("missing required {CODEX_HOME_FLAG}"))?;
if !codex_home.is_absolute() {
bail!(
"{CODEX_HOME_FLAG} must be absolute: {}",
codex_home.display()
);
}
let command_cwd = command_cwd.ok_or_else(|| anyhow!("missing required {COMMAND_CWD_FLAG}"))?;
if workspace_roots.is_empty() {
workspace_roots.push(command_cwd.clone());
}
Ok(WindowsSandboxWrapperRequest {
codex_home,
command_cwd,
workspace_roots,
env_map: env_map.ok_or_else(|| anyhow!("missing required {ENV_JSON_FLAG}"))?,
permission_profile: permission_profile
.ok_or_else(|| anyhow!("missing required {PERMISSION_PROFILE_FLAG}"))?,
windows_sandbox_level: windows_sandbox_level
.ok_or_else(|| anyhow!("missing required {SANDBOX_LEVEL_FLAG}"))?,
windows_sandbox_private_desktop,
proxy_enforced,
network_proxy_restricting_sid,
proxy_settings_mode,
read_roots_override,
read_roots_include_platform_defaults,View on GitHub (pinned to 339751715c)
Solutions
- Pass the required command-cwd flag with the working directory for the sandboxed command.
When it happens
Trigger: Thrown at codex-rs/windows-sandbox-rs/src/wrapper.rs:293 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/f43cc93190287da2.
Report an issue: GitHub.