Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedjuliusmarmingemerged 1 commit intot3code/codex-turn-mapping fromrefs/pull/13467/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

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
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. 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).
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—4.9 KiB—6.8 KiB✅
      CodexThread snapshot wire—3.7 KiB—4.9 KiB✅
      CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      CodexLive turn WebSocket decoded—20.4 KiB—29.3 KiB✅
      CodexLive turn messages—2—8✅
      ClaudeTotal thread wire—4.9 KiB—6.8 KiB✅
      ClaudeThread snapshot wire—3.7 KiB—4.9 KiB✅
      ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      ClaudeLive turn WebSocket decoded—20.8 KiB—29.3 KiB✅
      ClaudeLive 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.

    4. juliusmarminge merged thisc121adc

    5. juliusmarminge closed this

Sign in to join this conversation.