fix(codex): prevent catalog agents in ChatGPT sharing #28143
main fromrefs/pull/28143/head·opened View on GitHubProblem#
Managed Codex sessions using Connect with ChatGPT already disable features.multi_agent and features.multi_agent_v2. A model catalog entry with multi_agent_version: "v2" can still expose native agent tools, leading to subscription_sharing_unsupported_capability for input and repeated failures when continuing the affected conversation.
Change#
Add agents.enabled=false to the managed runtime launch overrides, keeping both existing feature flags disabled. Codex uses this setting to select the disabled-agent override before falling back to the model catalog.
Assert the setting in the existing primary/additional-account and managed/local-executable test matrix. Build the existing home-path assertion with path.join so the additional-account cases also reach the agent assertions on Windows.
Scope and approval#
This completes the managed-sharing restriction introduced by merged PR #17499. Related evidence: #17679 and the native-agent failures in #21061.
The established capability is ChatGPT subscription sharing through the managed openai_token_sharing runtime. Its launch configuration already disables native multi-agent features; agents.enabled closes the model-catalog fallback in that same configuration. The additional test correction is needed to exercise that restriction across the full existing matrix on Windows.
The implementation follows @pirut's closed, unmerged #20270. The maintainer takeover comment explicitly left human approval outstanding. No maintainer approval is claimed for this PR. Disabling catalog-provided native agents changes the runtime's effective capabilities, so Macroscope's requested human review remains pending.
Verification#
- Windows x64:
vp test run apps/server/src/provider/CodexManagedRuntime.test.tspasses all four existing cases. Before the path correction, both additional-account cases failed at the POSIX-only path assertion; that assertion is also present in base commit79f1fadfc602. - Regression check: temporarily removing only the production agent override makes all four cases fail specifically on the missing
agents.enabled=falseargument. Restoring it makes the suite pass. - With the repository's pinned Node 26.12.1,
vp run check:changed 79f1fadfc6020b820d541ca4691d2feebb15dd1bpasses formatting, lint, both knip checks, generated GraphQL verification, typechecking of three affected packages, and all five selected tests. git diff --checkpasses.- The original implementation's isolated Codex 0.163.0 probe used a v2-agent model catalog and a mock HTTP endpoint: feature flags alone exposed six native agent tools, while adding
agents.enabled=falseexposed none. This follow-up changes only the test's path assertion; that CLI probe was not rerun.
Upstream Actions require maintainer approval before execution and are not counted as passing CI. A complete T3 conversation with a real account and other operating systems was not exercised. The change prevents new native-agent histories; existing affected conversations are not repaired. Separate unsupported-capability reports such as tool_search remain outside this fix.
Original runtime implementation: GPT-6 Astra through the Codex harness in T3 Code. Windows test correction and PR documentation: GPT-6 through Codex.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 79f1fad
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
70045a89-2e55-42b0-b600-9c14be3ef02c
Commits-
Reviewing files that changed from the base of the PR and between 3e12accb4bef36d2d30da3691e4b285956b9aef2 and c9b0ece1a9ad3638b2f8f7f5ea67d812905ad834.
Files selected for processing: 1-
apps/server/src/provider/CodexManagedRuntime.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
Walkthrough
-
The managed Codex launch arguments now include
agents.enabled=false. The tests check that argument and build the additional-account home-path suffix withPath.join.Changes: Codex agent setting
Layer / File(s) Summary Managed launch arguments and tests
apps/server/src/provider/CodexManagedRuntime.ts,apps/server/src/provider/CodexManagedRuntime.test.tsmanagedCodexLaunchArgsaddsagents.enabled=false. The tests check the launch argument and usePath.joinfor the expected additional-account home-path suffix.Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk:
Minimal · up toc9b0e-
No actionable merge risk was identified; the change is ready to merge.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the primary change: preventing catalog-provided agents in ChatGPT sharing. Description check The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure mode, implementation, test coverage, approval status, limitations, and obs… 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 includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure mode, implementation, test coverage, approval status, limitations, and observed results. It also identifies that maintainer approval remains pending rather than claiming approval that was not received.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge added labelsbugfix
juliusmarminge added labelspr:needs-julius
tanstack-source added labelsbug
Additional Linux verification, including a real ChatGPT-sharing trial.
Tested this PR’s changes from
c9b0ece1a9ad, applied to main5ccc65be0a2b. The published branch and installed app were not changed.Runtime result#
Using Codex 0.166.0,
gpt-6.1-sol/ medium,openai_token_sharing, and a cached v2-agent catalog entry:- Without
agents.enabled=false, three fresh trials completed the baseline but failed both the native-spawn turn and ordinary follow-up. Reproduction and outgoing-request evidence are described in #29992. - With
agents.enabled=false, one real-provider trial advertised nocollaboration.*tools and completedBASELINE_OK, thenAGENTS_UNAVAILABLEwhen asked for a worker, thenFOLLOWUP_OK.
The corresponding mock catalog probe also confirmed the previously reported tool-exposure result: six collaboration tools without the setting, none with it.
Regression proof#
vp test run apps/server/src/provider/CodexManagedRuntime.test.ts --maxWorkers=2
With the new assertions present but the production override absent, all four matrix cases failed specifically on missing
agents.enabled=false. Restoring the override made all four pass.With #28962’s change also present, both relevant test files passed all 71 tests, and server-only typechecking passed with Node 26.12.1.
Scope: isolated app-server trials, not a patched desktop UI; prevention of this native-agent path, not repair of already-rejected histories. These are local validation results, not a claim of CI or maintainer approval.
Investigation assisted by GPT-6.1 Sol through Codex in T3 Code.
Update (Nov 18): I reran this through the T3 CLI on stable 0.1.10 (Ubuntu 26.04.1, Connect with ChatGPT, Codex 0.166.0,
gpt-6.1-sol). On stock, the native spawn (fork_turns="none") and the next plain-text turn both failed. With only this PR (c9b0ece1) applied, the same prompts on a fresh T3 thread made no native tool call, and the follow-up recalled the marker in the original Codex conversation without a recovery handoff.- Without
Note
🤖 Claude Opus 5.5 responding on behalf of cro13
This still reproduces on T3 Code 0.1.10-nightly.20261111 (macOS, Connect with ChatGPT,
gpt-6.1-sol, Codex 0.164.0), and this PR's change fixes it on currentmain.Field occurrence: nine
subscription_sharing_unsupported_capabilityerrors withparam: "input"across two threads. Each came right after the model calledcollaboration.spawn_agent. In every affected rollout, the failures start with the first request that carries anagent_messageitem, and the parent threads then also failed on plaincontinuefollow-ups.Checked against
mainatf313d0a6cb:CodexManagedRuntime.test.ts: without the production change, all 4 cases fail on the missingagents.enabled=false; with it, 4/4 pass.vp run check:changed: format, lint, both knip passes, typecheck (41 packages) and the selected tests pass. This ran on Node 22.23.3, not the pinned 26.12.1.- Loopback mock,
codex execwith main's managed flags, Codex 0.164.0 and 0.156.1:
Model metadata for gpt-6.1-solmain's flags with agents.enabled=falsecatalog entry with multi_agent_version: "v2"6 collaboration.*tools + multi-agent role promptnone no catalog (Codex's bundled models.json, alsov2)multi_agent_version=v2disabledcatalog entry without multi_agent_versiondisableddisabledThe last row shows the feature flags do work when the model metadata names no version, so the catalog/bundled
v2is what overrides them (0.164.0 only for rows 2 and 3).Not checked: a real ChatGPT-sharing turn with this patch applied.
This still reproduces on the 0.1.10 stable desktop build on Windows 11, with Codex CLI 0.170.0 and
gpt-6.2-astraover Connect with ChatGPT (openai_token_sharing). It happened in a plain top-level thread, with nodelegate_task. Details are in #39101.Field occurrence
- T3 now injects a
<multi_agent_mode>… Do not spawn sub-agents unless … skill instructions explicitly ask …</multi_agent_mode>instruction, butcollaboration.spawn_agentis still in the tool list. A skill recommended a helper agent, so the model spawned one. - The child failed on its first request with
subscription_sharing_unsupported_capability, and the parent turn failed with the same error. - The child's FINAL_ANSWER is now stored as an
agent_messageitem in the parent history. Every later turn in that thread failed within 2–3 s, including after switching the model togpt-6.2-sol.
Windows check of this PR (applied to
main470ca63499, Node 26.13.1,vp test run src/provider/CodexManagedRuntime.test.ts)managed primary local primary managed additional local additional mainpass pass symlink EPERM symlink EPERM this PR's test change only fail: expected [...] to include 'agents.enabled=false'fail (same) fail fail full PR pass pass symlink EPERM symlink EPERM The two additional-account cases fail before they reach the new assertion, on
maintoo. The cause isProviderSetupError: Codex shadow home filesystem operation 'symlink' failed: Windows refuses to create symlinks without Developer Mode or elevation. That's an environment limit, not this change. Thepath.joinfix in this PR is still needed for those cases once symlinks are allowed.So the primary-account cases go red→green with the one-line
agents.enabled=false. That matches the root cause the maintainer confirmed on #37386.- T3 now injects a
This PR conflicts with
main. Rebase it or mergemaininto it. If it still conflicts after 7 days with no activity, it will be closed automatically.See the conflict window.
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
matteodante(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — The change disables catalog-provided native agents for managed ChatGPT-sharing sessions to prevent unsupported-capability failures. Human review is required to confirm this change to the runtime’s effective default capabilities.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).