Description
When running a workflow with engine: codex on a self-hosted Linux runner, the agent step
fails with:
error: unexpected argument '--dangerously-bypass-approvals-and-sandbox' found
tip: to pass '--dangerously-bypass-approvals-and-sandbox' as a value, use
'-- --dangerously-bypass-approvals-and-sandbox'
Usage: codex-x86_64-unknown-linux-musl exec [OPTIONS]
Steps to reproduce
- Configure a self-hosted Linux runner (WSL2 on Windows)
- Create a workflow with
engine: codex and runs-on: ['self-hosted', 'Linux']
- Trigger the workflow
- The "Install Codex" step runs
npm install -g @openai/codex@latest successfully
- The agent container then calls
codex exec --dangerously-bypass-approvals-and-sandbox
against the vendored codex-x86_64-unknown-linux-musl Rust binary
- That binary only supports
--full-auto, not --dangerously-bypass-approvals-and-sandbox
Expected behaviour
Agent executes successfully using the installed Codex binary.
Actual behaviour
Binary rejects the flag and exits with code 2.
Environment
- gh-aw agent container: ghcr.io/github/gh-aw-firewall/agent:0.23.0
- Runner OS: Ubuntu (WSL2 on Windows 11)
- @openai/codex: latest (installed by gh-aw's own Install Codex step)
- The vendored Rust binary
codex-x86_64-unknown-linux-musl exec --help shows
--full-auto but not --dangerously-bypass-approvals-and-sandbox
Notes
The host-installed codex binary at /home/USER/.nvm/versions/node/v22.22.1/bin/codex
DOES support the flag — the issue is specific to the vendored musl binary used inside
the agent container.