fix(server): Codex V2 sessions use the configured launch arguments - #13467
Conversation
The V2 Codex client factory spawned `codex app-server` with hard-coded arguments, so the provider's "Launch arguments" setting and the T3CODE_CODEX_LAUNCH_ARGS override never reached real sessions. Resolve them the same way the readiness probe and text generation do. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: 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. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
c121adc
into
t3code/codex-turn-mapping
…13467) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…13467) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…13467) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Codex provider's "Launch arguments" setting and the
T3CODE_CODEX_LAUNCH_ARGSoverride did nothing for real V2 sessions. The V2 client factory spawnedcodex app-serverwith hard-coded arguments, so flags like-c model_reasoning_summary=detailed,--enable <feature>, or--strict-configwere 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
codexAppServerClientFactoryFromSettingsLayernow builds its args withcodexAppServerArgs(resolveCodexLaunchArgs(input.settings.launchArgs, input.environment)), the same resolution the probe uses.input.environmentis 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 usecodexSessionAppServerArgs, which #13462 removes.Verification
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.["app-server"]restored, the test fails withexpected [ [ 'app-server' ], [ 'app-server' ] ].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.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code