fix(codex): launch-arg MCP servers survive the thread's t3-code server#15839
Fixes #15828.
Codex thread config previously sent a whole mcp_servers table containing only T3's server. Thread overrides share the process launch-argument override layer, so this replaced MCP servers supplied through instance launch arguments.
Use the dotted mcp_servers.t3-code key at the shared adapter boundary. Thread start, resume, fork, and rollback's resume retain launch-argument servers while configuring T3's session endpoint and authorization. Main's 10-second startup grace and 3,900-second T3 tool timeout are preserved. Replay matching ignores both historical whole-table MCP config and dotted mcp_servers.* keys, preserving comparisons for unrelated thread config.
Maintainer takeover of @lnieuwenhuis's implementation in #15839, preserving contributor commits and merging main. This remains one adapter/replay concern on the original PR. The shared server path covers web, desktop, mobile, remote connections, and scheduled turns without client or contract changes.
Verification on headless Linux:
- Replaced one static helper expectation with two behavior regressions in the existing adapter test file: an actual adapter thread-start request with the dotted key, and replay of historical/dotted recordings with different endpoint/auth/extra-server settings. The replay test also confirms unrelated config differences still fail. Both tests fail against main and pass after restoring the fix. Test cases in the selected suites: 171 → 172; changed test files: 1 → 1.
- 172 adapter/fixture tests and 24 actual Codex orchestrator replay cases pass. Scoped lint and formatting, server and app-server package typechecks, and whitespace checks pass. CI identified a helper export left unused by the test rewrite; it is now private, and a server-only Knip export check passes. Lint reports two existing unused-variable warnings outside the changed region.
- Installed Codex 0.163.0 app-server with isolated temporary homes and local HTTP/stdio MCP fixtures: the baseline whole-table request starts only
t3-code; the dotted request generated by the production adapter helper starts botht3-codeand the launch-argument serverextra. Both reachready. All other generated thread settings are identical. The fixture loader exposes the private helper without changing its body. No account credentials or model inference were used. - Two independent full-diff review rounds with Claude Opus 5.5 and GPT-6 Sol found no code blockers.
Screenshots do not apply to this protocol/configuration change. Live verification covers thread start; resume/fork/rollback share the inspected helper and are covered by recorded orchestration flows, rather than separate live account runs. macOS, Windows, iOS, Android, and Electron desktop were not exercised. The author's original Codex 0.160 experiment was not rerun. No real account session or user MCP server was used.
Unmerged. Current-head CI passes, including the repaired Knip check. Macroscope requests human approval of enabling launch-argument MCP servers alongside T3’s server.
Implementation: GPT-6.1 Sol in Codex. Tests: GPT-6 Astra in Codex. Reviews: Claude Opus 5.5 in Claude Code and GPT-6 Sol in Codex.
Checks
Added 1 commit
- fix(codex): launch-arg MCP servers survive the thread's t3-code server157d583
Approvability
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This focused Codex MCP fix changes configuration precedence across thread start, resume, fork, and rollback, allowing previously suppressed launch-argument MCP servers to start alongside T3’s server. The scope and tests are strong, but the activated runtime work is substantial enough to merit human review.
You can add or adjust custom eligibility rules. Learn more.
Warning
Review limit reached
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 4 minutes.
View limit details
Limit details: You’ve used all 10 included reviews currently available.
Review configuration:
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
efc26623-681a-455f-b29c-7e597ceac9f2
📥 Commits
Reviewing files that changed from the base of the PR and between 8cb87d61bf89ea4529e5fdce36084857a71863c3 and 3c34a9750e0dc01e3030ada5136bc8b2eece7d43.
📒 Files selected for processing: 3
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.tspackages/effect-codex-app-server/src/replay.ts
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fa8513b4-e904-4267-b770-b665c2c428be
📥 Commits
Reviewing files that changed from the base of the PR and between 39dd5d4d808aae13c6d6a1c57a2ce45174d6cb95 and 8cb87d61bf89ea4529e5fdce36084857a71863c3.
📒 Files selected for processing: 3
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.tspackages/effect-codex-app-server/src/replay.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
📝 Walkthrough
The Codex thread configuration now sets the T3 MCP server with a dotted key. Replay normalization excludes nested and dotted MCP server configuration keys. Adapter tests cover session MCP configuration and replay matching.
Changes: Codex MCP configuration override
Layer / File(s) Summary Configure and normalize thread MCP servers
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts,packages/effect-codex-app-server/src/replay.ts,apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsThe thread runtime config sets t3-codeundermcp_servers.t3-code, preserving its URL, timeout, and authorization header. Replay normalization filtersmcp_serversand keys prefixed bymcp_servers.. Tests check the session MCP values inthread/startparameters and confirm replay accepts nested or dotted MCP entries while still detecting a difference in other configuration.Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to 8cb87
The change has no identified merge-blocking issue after normal checks. Resume, fork, and rollback were not separately live-tested, but no failure on those paths is established.
Architecture risk: 🔵 Low · up to 8cb87
The change affects 2 systems.
Changed systems: apps/server, packages/effect-codex-app-server
Architecture concerns No architecture-level concerns identified.
Review details
Systems and components
- observed — apps/server (service) was modified; 2 changed files map to changed impact.
- observed — packages/effect-codex-app-server (library) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Removed the test asserting thread-scoped parameters contained the cwd, model, and MCP server authorization configuration.
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Added a replay test that sets a session MCP server and checks that
thread/startparameters include its URL, authorization header, and timeout alongside the existing configuration. - observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Added replay assertions for both nested and dotted historical MCP configuration keys. The replay accepts those MCP entries when other configuration matches, and reports a frame mismatch when
tools.update_plan.enableddiffers. - observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts: The T3 MCP server configuration now uses the
mcp_servers.t3-codekey instead of amcp_serversobject containingt3-code; its URL, timeout, and authorization header are unchanged.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title clearly describes the Codex MCP preservation fix and uses a concise conventional-commit format. Linked Issues check Passed Issue #15828requires Codex provider threads to keep instance launch-argument MCP servers and add T3'st3-codeserver.codexThreadRuntimeParamsnow sends onlymcp_servers.t3-codewith the existi…Out of Scope Changes check Passed The changed replay normalizer removes historical whole-table mcp_serversand dottedmcp_servers.*keys before comparison. It still compares unrelated thread configuration, as shown by the regressi…Description check Passed The description covers the problem, implementation, scope, linked issue, verification results, limitations, and tooling. It does not include an explicit maintainer approval comment as requested by the… Full details: Linked Issues check
Explanation
Issue
#15828requires Codex provider threads to keep instance launch-argument MCP servers and add T3'st3-codeserver.codexThreadRuntimeParamsnow sends onlymcp_servers.t3-codewith the existing endpoint, authorization, 10-second startup grace, and 3,900-second timeout. The shared helper covers thread start, resume, fork, and rollback resume. The adapter regression test checks the generatedthread/startrequest, and the reported live test confirms both servers reachready. No global Codex configuration change was added.
Full details: Out of Scope Changes check
Explanation
The changed replay normalizer removes historical whole-table
mcp_serversand dottedmcp_servers.*keys before comparison. It still compares unrelated thread configuration, as shown by the regression test. This change supports replay of the new adapter configuration and historical recordings. The adapter test replaces a stale shape assertion with behavior coverage. The whole-PR changes remain within the MCP configuration and replay scope of issue#15828.
Full details: Description check
Explanation
The description covers the problem, implementation, scope, linked issue, verification results, limitations, and tooling. It does not include an explicit maintainer approval comment as requested by the Scope and approval template, but the description is otherwise substantially complete.
✨ Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Added 2 commits
Taking over this one for batch codex-01. I will resolve the adapter and replay conflicts against current main, keep the MCP override fix focused, rebuild minimal regression coverage, and run independent reviews before pushing here. The PR will remain unmerged.
Added 2 commits