Repository navigation
Conversation
Codex was the last CLI harness whose sandbox worker ran on the task image's python3, only because its HTTP 429 retry proxy was Python. Run Codex through the shared harness_runner.sh, behind a small Node launcher (sandbox_launcher.mjs) on the Node that the Codex runtime already installs. The launcher keeps the proxy's behaviour (two 429 retries honouring Retry-After up to 30 s, attempt records, transport errors), the environment allowlist and TERM forwarding, and exits with Codex's status as a shell would. The native-session snapshot moves to the same launcher. The bootstrap, workdir overlap check and installer no longer need python3. With no remaining user, stdlib_runner and the bin/gym-runner interpreter link are removed, as the harness docs promised. Codex tests that need Node install it at collection on Linux, through setup_codex.ensure_node(), so CI keeps running them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
Contributor
Author
|
/ok to test 0b80097 |
Contributor
…o refactor/codex-bash-runner
Contributor
Author
|
/ok to test 7cd0f96 |
…om:NVIDIA-NeMo/Gym into refactor/codex-bash-runner Signed-off-by: yaoyu-33 <[email protected]> # Conflicts: # fern/versions/latest/pages/agent-server/add-or-update-a-harness.mdx
yaoyu-33
changed the base branch from
main
to
yaoyu-33/host-built-hermes-stirrup-runtime
October 27, 2026 20:33
Contributor
Author
|
/ok to test 44288ba |
This was referenced Oct 27, 2026
yaoyu-33
changed the base branch from
yaoyu-33/host-built-hermes-stirrup-runtime
to
fix/host-built-hermes-stirrup-runtime
October 27, 2026 20:52
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Codex was the last CLI harness whose sandbox worker ran on the task image's
python3. This moves it onto the shared bash runner, so no sandboxed CLI harness needs Python in the task image any more.harness_runner.sh, like Claude Code, OpenCode, Kilo, OpenClaw and Pi. The runner supplies the prompt on stdin, stamps stdout as events, keeps stderr and writesruntime.json.sandbox_launcher.mjs, which runs on the Node 22.19.0 that the Codex runtime already installs. It starts the forwarder on a loopback port, then starts Codex with-c model_providers.gym.base_url=<forwarder>.native_session.jsonl) moves to the same launcher (--snapshot).python3, and the workdir overlap check is POSIXsh. The installer drops its Python version assertion and itsctypeslibstdc++ probe, replaced by the musl path check Pi already uses.stdlib_runner,check_stdlib_runner, thebin/gym-runnerinterpreter link andRUNNER_FILEare removed. Codex was their only user, and refactor(agent_utils): run sandboxed harnesses with only bash in the task image #5094's harness docs said they would go once Codex no longer needed the task image's Python.sandbox_runner.pyon the task image'spython3(≥ 3.8), run asbin/gym-runnerharness_runner.shsandbox_transport.py(stdlibhttp.server+urllib)sandbox_launcher.mjson the runtime's Nodepython3 sandbox_runner --snapshotnode sandbox_launcher.mjs --snapshotpython3andbash; overlap check withpython3 -cbash; POSIXshoverlap checkctypeslibstdc++ probe on musllibstdc++.so.6path check on muslWhy
@hemildesai asked to move the remaining harnesses off the task image's Python as a follow-up to #5094. Codex was the only CLI harness left. The Python harnesses are covered separately:
No separate issue: this follows the review discussion on #5094.
Behaviour kept from the Python worker
The launcher keeps the Python worker's behaviour in all of these:
Retry-Afteris honoured, clamped to [0, 30] s. A non-numeric or non-finite value backs off 1 s, then 2 s.model_attempts.jsonl:status: nullplus the error when the connection fails; the forwarder then answers 502;transport_errorwhen the upstream body is cut short or times out.x-session-idis replaced with the invocation ID.PATH,LANG,LC_ALL,HOME,XDG_*,NEMO_GYM_SUPERVISOR) plus the adapter's variables. The runner drops a taskNODE_OPTIONSbefore the launcher starts, the waypython3 -IignoredPYTHON*variables.TERMis passed on to Codex, so a stopped Codex can still flush its last events.Two differences, both deliberate:
agent: false), likeurlopendid. Node, unlikeurllib, ignoreshttp_proxy, which Codex itself never saw either.\n,\r\nand\r. Python'ssplitlines()also split at U+2028 and similar characters, which JSON may contain unescaped inside a string, and so could break a native-session record in two.Compatibility
SandboxCommand(stdlib_runner=...)andsupervised_launch_command(stdlib_runner=...)are removed.nemo_gym.agent_utils.sandbox_session.RUNNER_FILEandsupervisor_client.RUNNER_INTERPRETERare removed too. The migration list inadd-or-update-a-harness.mdxsays so.HarnessProcessInfo.python(Codex) is removed;runtime.jsonnow comes from the runner and carrieshostnameandpid.Tests
test_sandbox_runner.pynow runs a staged activation through the real supervisor, runner and launcher. It covers:NODE_OPTIONS;TERMreaching Codex;TERMdeath (143) and a missing binary (127);test_sandbox_launcher.pytests the forwarder against real HTTP servers:Retry-Afterparsing;codex_agent/tests/conftest.pyinstalls Node at collection on Linux through a newsetup_codex.ensure_node(), which reuses the existing local-mode Node installer, and the install directory is gitignored.pkilltest intest_sandbox_supervisor_client.pynow checks the bash runner instead of the interpreter link. Thestdlib_runnercases are removed from the bootstrap tests.Validation
pytest responses_api_agents/codex_agent/tests tests/unit_tests/test_sandbox_supervisor_{bootstrap,client}.py tests/unit_tests/test_sandbox_session.py tests/unit_tests/test_harness_runner.py: 417 passed, 48 skipped (Linux-only), 1 failed:test_opensandbox_sdk_is_available_in_agent_environment, becauseopensandboxis missing from the local venv.05bac0530: the same suites plustest_process_supervisor.py: 508 passed, 6 skipped. Before that merge, refactor(agent_utils): run sandboxed harnesses with only bash in the task image #5094'sforking_toolsupervisor test failed on this host, with or without this change;05bac0530makes forced-stop scans cheaper and fixes it.pre-commit run --files <changed files>: passed.Smoke run with the real Codex CLI: the full adapter flow on a workstation, driven through the agent's HTTP routes (seed, activation, close), with each task sandbox a Docker container. Codex 0.144.4 was installed into the container by the real installer, and the model was a scripted Responses server on the host that answers 429 once, then a completed message. Results:
debian:bookworm-slim(glibc, bash present)completed, output "Done.", attempts[429, 200], receipt confirmed with return code 0, native transcript collectedalpine:3.20(musl, no bash)shbootstrap installed bash and the installer added its missing packages withapk; same result as DebianRollout evidence with a real model: pending. This stays a draft until a Codex rollout with a served model runs through the launcher, together with #5094's rollouts.
🤖 Generated with Claude Code