fix(server): Codex V2 sessions use the configured launch arguments #13467
t3code/codex-turn-mapping fromrefs/pull/13467/head·merged by juliusmarminge View on GitHubThe Codex provider's "Launch arguments" setting and the T3CODE_CODEX_LAUNCH_ARGS override did nothing for real V2 sessions. The V2 client factory spawned codex app-server with hard-coded arguments, so flags like -c model_reasoning_summary=detailed, --enable <feature>, or --strict-config were dropped. The readiness probe, skills probe, reset-credit call, and text generation all honor them. So did the V1 runtime that is being removed.
Change#
codexAppServerClientFactoryFromSettingsLayer now builds its args with codexAppServerArgs(resolveCodexLaunchArgs(input.settings.launchArgs, input.environment)), the same resolution the probe uses. input.environment is the instance environment the driver merges over the host env, so the env override takes precedence over the setting exactly as it does for the probe. This doesn't use codexSessionAppServerArgs, which #13462 removes.
Verification#
- New test in
CodexAdapterV2.test.ts("launches the app-server with the configured launch arguments"). It drives the realcodexAppServerClientFactoryFromSettingsLayerwith a spawner that records the command, and asserts the args for configured launch args and for theT3CODE_CODEX_LAUNCH_ARGSoverride winning over them. - Revert check: with the old hard-coded
["app-server"]restored, the test fails withexpected [ [ 'app-server' ], [ 'app-server' ] ]. - Live check with Codex 0.156.1, using a throwaway test that isn't committed: I opened sessions through the same factory against a temp
CODEX_HOMEand read backconfig/read.model_reasoning_summarywas"detailed"from the setting,"concise"from the env override, andnullwith neither. With the fix reverted, all three came backnull. vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts src/provider/Layers/codexLaunchArgs.test.ts: 121 passed.vp exec tsc --noEmit -p .inapps/server: no errors.vp linton the two touched files: no new warnings. The two existing unused-variable warnings inCodexAdapterV2.tsare unrelated.- Not run: repo-wide checks and the replay fixture suite. This path only touches process spawn args, which replay fixtures bypass.
Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
ℹ️ No successful
mainbaseline artifact is available yet. This run establishes the initial measurement.Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅ Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅ Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅ Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅ Codex Live turn messages — 2 — 8 ✅ Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅ Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅ Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅ Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅ Claude Live turn messages — 2 — 8 ✅ Baseline: unavailable · PR result:
90d6ed9· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 106.1 KiB
- Claude decoded thread snapshot: 106.4 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
juliusmarminge merged thisc121adc
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This fixes Codex V2 session spawning so existing launch-argument configuration is honored and adds focused coverage for settings and environment precedence. Because those arguments can materially alter the behavior of the production Codex app-server process, the change warrants human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).