fix(server): use Codex native collaboration modes #24737
main fromrefs/pull/24737/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubT3 copied Codex's Plan and Default prompts, so its behavior could drift from the installed Codex version. The copies were also tied to T3 MCP, and Default turns without MCP did not explicitly leave a previous Plan mode.
Use native turn/start.collaborationMode on every turn and omit settings.developer_instructions. Codex fills in its bundled mode instructions, with model-catalog overrides taking precedence. Delete both prompt copies and their selector. Keep T3 tool context conditional on MCP.
This removes 9,197 Plan / 966 Default prompt characters from T3's per-turn app-server request. Codex still supplies its own mode instructions to the model; this is not a claim of equivalent model-token savings.
Validation:
- New tests failed before the fix. All 87 focused tests pass, covering both modes, MCP present/absent, and default/explicit reasoning effort. Updated replay expectations.
vp run check:changedpassed.- Live Codex 0.160.0, isolated home/workspace, no T3 MCP, and no client mode prompt:
Plan: greeting.txt absent; <proposed_plan> emitted as native item/plan.
Default: greeting.txt created with the exact requested content.
Fresh app-server + thread/resume: mode switching still works.
request_user_input with Default feature off: TOOL_UNAVAILABLE.
With feature on: Plan isBlocking=true; Default isBlocking=false; both answers accepted.
The bundled fallback is present in T3's managed Codex 0.156.1 as well: app-server mode normalization. Codex's catalog precedence remains intact.
Created with GPT-6.1 Sol in Codex.
- 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:L
Approvability#
Verdict: Approved at
d123ca6Macroscope's review found this PR approvable — This is a focused Codex adapter fix that switches Plan/Default handling to Codex's native collaboration-mode protocol and removes duplicated prompt instructions. Production logic is confined to the adapter, with the other changes updating tests and replay expectations.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: fix/codex-native-collaboration-modes
- File: .coderabbit.config.ts
- Commit: d123ca6
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
1ff0130b-d64e-4e9f-b767-9f82a87cbbdb
Commits-
Reviewing files that changed from the base of the PR and between d4357f80aef6be594a3c86409d566656600bc361 and d123ca6a5d4caa9e6168c2087922930dcfeec652.
Files selected for processing: 29-
apps/server/src/orchestration-v2/testkit/fixtures/command_output_streaming/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/delegated_task_status/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/message_steering/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/multi_turn/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/queued_turn/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/simple/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/subagent/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/subagent_continue/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/subagent_v2/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/subagent_v2_approval/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/subagent_v2_nested/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/subagent_v2_nested_approval/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_fork_native_continue/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_fork_native_prior_turn/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_fork_native_siblings/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_merge_back_siblings/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_rollback/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_rollback_after_restart/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/thread_rollback_to_stopped_turn/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/todo_list/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/tool_call_read_only_on_request/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/tool_call_restricted_granular/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/tool_call_workspace_never/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/codex_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/web_search/codex_transcript.ndjson
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
Walkthrough
-
The Codex adapter now always sends collaboration mode settings based on the runtime interaction mode. The provider no longer builds mode-specific developer instructions. Tests and replay fixtures cover the updated turn-start parameters.
Changes: Codex turn-start behavior
Priority:Layer / File(s) Summary Runtime mode and turn-start parameters
apps/server/src/provider/CodexDeveloperInstructions.ts,apps/server/src/provider/CodexDeveloperInstructions.test.ts,apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsThe provider removes the mode-specific developer-instruction builder and retains CodexRuntimeInfo. The adapter always sends collaboration mode settings with the runtime interaction mode, model, and optional reasoning effort. Tests cover both interaction modes, reasoning effort, T3 MCP context, and replay expectations.Replay turn-start fixtures
apps/server/src/orchestration-v2/testkit/fixtures/*/codex_transcript.ndjsonFixtures add collaboration mode settings to recorded turn-start requests. Other fixture updates change recorded developer instructions, summary, or sandbox policy parameters. NormalEstimated code review effort: 3 (Moderate) | ~20 minutes
Possibly related PRs
- pingdotgg/t3code#24467: Changes model selection and reasoning effort for native Codex subagent turns, which affect the settings now sent in
turn/start.collaborationMode.
Suggested reviewers:
scratchyone,davisonio - pingdotgg/t3code#24467: Changes model selection and reasoning effort for native Codex subagent turns, which affect the settings now sent in
Merge Risk:
Minimal · up tod123c-
No actionable merge-blocking risk remains from the reviewed changes.
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check The description clearly explains the problem, implementation, and detailed verification results. It does not include the required Scope and approval section or explain why the change qualifies for an … Add a Scope and approval section. Link the triaged issue or maintainer approval, including the approval comment. If this is an obvious focused fix without prior approval, explain why it qualifies for that exemption and confirm that the chan… Passed checks: 3 passed-
Check name Status Explanation Title check The title clearly and concisely describes the main change: using Codex native collaboration modes in the server. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
Full details: Description check
-
Explanation
The description clearly explains the problem, implementation, and detailed verification results. It does not include the required Scope and approval section or explain why the change qualifies for an exemption from prior issue or maintainer approval.
Resolution
Add a Scope and approval section. Link the triaged issue or maintainer approval, including the approval comment. If this is an obvious focused fix without prior approval, explain why it qualifies for that exemption and confirm that the change remains within the established capability.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB −7 B (−0.1%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −7 B (−0.6%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB +24 B (+0.5%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +24 B (+2.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB +41 B (+0.2%) 29.3 KiB ✅ Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅ Baseline:
a0e0f8a· PR result:d123ca6· 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: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Factory catalog cross-reference — 2026-10-26. Already-upstream foundation: Codex native collaboration modes are part of official nightly 3669, the factory’s exact base; this merged PR needs no reapplication.
Factory Ideas · Pinned fork source/guide · Source release. Version-pinned community experimental source preview; full lifecycle acceptance remains open. No upstream endorsement or current-PR-head test acceptance is claimed.
Prepared with GPT-6.1 Sol through Codex in T3 Code.
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed