Repository navigation
perf(sandbox): run the Codex binary without its Node launcher - #4118
Merged
Merged
Conversation
Codex installs from npm with a JavaScript launcher (bin/codex.js) that finds the native binary, spawns it, and then waits as its parent for the whole run, relaying signals and the exit status: a Node process of about 40 MB and some 60 ms of start-up on every Codex turn, doing nothing else. The image now puts a three-line shell launcher at /opt/agents/bin/codex that execs the native binary directly, with the environment the npm launcher sets (CODEX_MANAGED_BY_NPM, CODEX_MANAGED_PACKAGE_ROOT). The image build resolves the binary the way that launcher does and fails if it is missing; the conformance test checks the launcher and runs it.
The harness ledger row now says codex on PATH is the direct launcher, and that the image conformance test checks it and runs it.
yannickmonney
force-pushed
the
perf/sandbox-codex-direct
branch
from
October 3, 2026 08:44
18439a5 to
d04393b
Compare
Contributor
Author
|
Independent review of PR #4118 at
Verified correct
LOW
INFO
It merges once the exact-head checks are all green. |
This was referenced Oct 3, 2026
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.
Why
Codex installs from npm with a JavaScript launcher (
bin/codex.js). It finds the native binary, spawns it, and then waits as its parent for the whole run, relaying signals and the exit status. That is a Node process — about 40 MB idle, ~60 ms to start — held for every Codex turn, doing nothing else.What changes
/opt/agents/bin/codexis now a three-line shell launcher (services/sandbox-runtime/codex-launcher.in) that execs the native binary directly, with the environment the npm launcher sets:CODEX_MANAGED_BY_NPM=1andCODEX_MANAGED_PACKAGE_ROOT(the package root's realpath). Signals now reach the binary itself, and its exit status is the launcher's.codex.jsdoes (the platform package@openai/codex-linux-{x64,arm64}beside the launcher, else the package's ownvendor/), fails the build if it is not executable, and runscodex --versionthrough the new launcher.Gemini CLI and Qwen Code were checked too: Gemini relaunches itself only when its
autoConfigureMemorysetting is on (the staged settings leave it off), and Qwen's entry does more than relay (update pins, home resolution), so both stay as they are.Verification
codexon PATH is the direct launcher and still runscodex --version; CI's image build runs the resolution step itself. (Docker on the authoring machine is down, so CI is where the image step runs first.)Follows #4116 and #4117.