Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): use Codex native collaboration modes #24737

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/24737/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

T3 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:changed passed.
  • 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. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at d123ca6

      Macroscope'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.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      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.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/delegated_task_status/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/message_steering/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/plan_questions/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/proposed_plan/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/queued_turn/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/simple/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/subagent/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/subagent_continue/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/subagent_v2/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/subagent_v2_approval/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/subagent_v2_nested/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/subagent_v2_nested_approval/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_fork_native_continue/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_fork_native_prior_turn/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_fork_native_siblings/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_merge_back_siblings/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_rollback/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_rollback_after_restart/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/thread_rollback_to_stopped_turn/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/todo_list/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/tool_call_read_only_on_request/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/tool_call_restricted_granular/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/tool_call_workspace_never/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/codex_transcript.ndjson
      • apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/codex_transcript.ndjson
      • apps/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

      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.ts
      The 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.ndjson
      Fixtures add collaboration mode settings to recorded turn-start requests. Other fixture updates change recorded developer instructions, summary, or sandbox policy parameters.
      Priority: Normal

      Estimated 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

      Merge Risk: Minimal · up to d123c

      No actionable merge-blocking risk remains from the reviewed changes.

      Pre-merge checks: Passed 3 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Description checkWarningThe 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 Passed checks: 3 passed
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: using Codex native collaboration modes in the server.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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
      Comment `@coderabbitai help` to get the list of available commands.
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB−7 B (−0.1%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB−7 B (−0.6%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB+24 B (+0.5%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB+24 B (+2.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB+41 B (+0.2%)29.3 KiB✅
      ClaudeLive turn messages12+1 (+100.0%)8✅

      Baseline: a0e0f8a · PR result: d123ca6 · 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: 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.

    4. 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.