Skip to content

fix(server): Codex V2 sessions use the configured launch arguments - #13467

Merged
juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
v2/codex-launch-args
Sep 24, 2026
Merged

juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
v2/codex-launch-args

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

The 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 real codexAppServerClientFactoryFromSettingsLayer with a spawner that records the command, and asserts the args for configured launch args and for the T3CODE_CODEX_LAUNCH_ARGS override winning over them.
  • Revert check: with the old hard-coded ["app-server"] restored, the test fails with expected [ [ '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_HOME and read back config/read. model_reasoning_summary was "detailed" from the setting, "concise" from the env override, and null with neither. With the fix reverted, all three came back null.
  • vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts src/provider/Layers/codexLaunchArgs.test.ts: 121 passed.
  • vp exec tsc --noEmit -p . in apps/server: no errors.
  • vp lint on the two touched files: no new warnings. The two existing unused-variable warnings in CodexAdapterV2.ts are 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


Devin Review

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>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 24, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline 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: success

Scenario 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
juliusmarminge merged commit c121adc into t3code/codex-turn-mapping Sep 24, 2026
24 of 25 checks passed
@juliusmarminge
juliusmarminge deleted the v2/codex-launch-args branch September 24, 2026 19:34
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
…13467)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
…13467)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 25, 2026
…13467)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant