Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): prevent catalog agents in ChatGPT sharing #28143

Closedmatteodante(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/28143/headopened View on GitHub

Problem

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.ts passes 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 commit 79f1fadfc602.
  • Regression check: temporarily removing only the production agent override makes all four cases fail specifically on the missing agents.enabled=false argument. Restoring it makes the suite pass.
  • With the repository's pinned Node 26.12.1, vp run check:changed 79f1fadfc6020b820d541ca4691d2feebb15dd1b passes formatting, lint, both knip checks, generated GraphQL verification, typechecking of three affected packages, and all five selected tests.
  • git diff --check passes.
  • 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=false exposed 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

    2. 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).
    3. 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 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 with Path.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.ts
      managedCodexLaunchArgs adds agents.enabled=false. The tests check the launch argument and use Path.join for 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 to c9b0e

      No actionable merge risk was identified; the change is ready to merge.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the primary change: preventing catalog-provided agents in ChatGPT sharing.
      Description checkPassedThe 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 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 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
    4. juliusmarminge added labelsbugfix

    5. juliusmarminge added labelspr:needs-julius

    6. tanstack-source added labelsbug

    7. dotspace42(GitHub profile, opens in a new tab)commented

      Additional Linux verification, including a real ChatGPT-sharing trial.

      Tested this PR’s changes from c9b0ece1a9ad, applied to main 5ccc65be0a2b. 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 no collaboration.* tools and completed BASELINE_OK, then AGENTS_UNAVAILABLE when asked for a worker, then FOLLOWUP_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.

    8. 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 current main.

      Field occurrence: nine subscription_sharing_unsupported_capability errors with param: "input" across two threads. Each came right after the model called collaboration.spawn_agent. In every affected rollout, the failures start with the first request that carries an agent_message item, and the parent threads then also failed on plain continue follow-ups.

      Checked against main at f313d0a6cb:

      • CodexManagedRuntime.test.ts: without the production change, all 4 cases fail on the missing agents.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 exec with main's managed flags, Codex 0.164.0 and 0.156.1:
      Model metadata for gpt-6.1-solmain's flagswith agents.enabled=false
      catalog entry with multi_agent_version: "v2"6 collaboration.* tools + multi-agent role promptnone
      no catalog (Codex's bundled models.json, also v2)multi_agent_version=v2disabled
      catalog entry without multi_agent_versiondisableddisabled

      The last row shows the feature flags do work when the model metadata names no version, so the catalog/bundled v2 is what overrides them (0.164.0 only for rows 2 and 3).

      Not checked: a real ChatGPT-sharing turn with this patch applied.

    9. This still reproduces on the 0.1.10 stable desktop build on Windows 11, with Codex CLI 0.170.0 and gpt-6.2-astra over Connect with ChatGPT (openai_token_sharing). It happened in a plain top-level thread, with no delegate_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, but collaboration.spawn_agent is 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_message item in the parent history. Every later turn in that thread failed within 2–3 s, including after switching the model to gpt-6.2-sol.

      Windows check of this PR (applied to main 470ca63499, Node 26.13.1, vp test run src/provider/CodexManagedRuntime.test.ts)

      managed primarylocal primarymanaged additionallocal additional
      mainpasspasssymlink EPERMsymlink EPERM
      this PR's test change onlyfail: expected [...] to include 'agents.enabled=false'fail (same)failfail
      full PRpasspasssymlink EPERMsymlink EPERM

      The two additional-account cases fail before they reach the new assertion, on main too. The cause is ProviderSetupError: 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. The path.join fix 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.

    10. This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

      See the conflict window.

Sign in to join this conversation.