fix(codex): disable agents for ChatGPT sharing #20270
main fromrefs/pull/20270/head·opened View on GitHubManaged Codex sessions using Connect with ChatGPT can still expose native agent tools when the model catalog selects multi_agent_version: "v2", despite the two existing disabled multi-agent feature flags. This can produce the unsupported native-agent history reported in #17679.
Add agents.enabled=false to the existing managed launch overrides. Codex checks this before catalog selection. Keep both feature flags disabled because an explicitly enabled V2 feature takes precedence over the agents switch. Ordinary local/API-key setup follows a separate path; the shared managed runtime supplies the setting to both app-server sessions and text-generation exec launches. No client or contract change is needed, including for remote clients.
Maintainer takeover of @pirut's implementation in #20270, preserving contributor commits and merging main. Retained the minimal two-line production change and reduced the test delta from a duplicate override parser and launch-builder assertion loop to one assertion in the existing account/executable matrix. This completes the restriction introduced in #17499; human approval is still outstanding.
Verification on headless Linux:
- Existing four runtime cases cover primary/additional accounts and managed/local executable selection within managed sharing. All four fail against main without the setting. No new cases or files: 5 → 5 runtime cases, and 28 → 28 passing tests across the managed-runtime, launch-argument, and Codex-driver suites. Existing main tests are preserved.
- Scoped lint, formatting, server typecheck, and whitespace checks pass.
- Installed Codex 0.163.0, isolated temporary homes, local catalog explicitly selecting agent V2, and a local scripted Responses endpoint: the original launch overrides advertised
spawn_agent,followup_task,send_message,wait_agent,interrupt_agent, andlist_agents. The final overrides advertised none of those six; code execution remained available. Both fixture requests returnedOKwith exit 0. The proof uses current production override values with only provider URLs redirected locally and a dummy token; no real credentials or model inference were used. - Independent full-diff reviews by Claude Opus 5.5 and GPT-6 Sol found no code blockers.
Screenshots do not apply to this launch-configuration change. The live check verifies CLI tool declarations rather than a complete coding/delegation/review cycle in T3. The author's original real-account success was not rerun. macOS, Windows, iOS, Android, and Electron desktop were not exercised. Existing conversations containing unsupported native-agent history are not repaired.
Closes #21061.
Current-head CI suites pass. Duplicate native-fingerprint cancellation has a successful replacement on the same head; it is not counted as a passing check. The PR remains unmerged for the human approval described above.
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.
- 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
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6f94ce65-ed08-4e8e-bd3a-babcde018d45
📥 Commits
-
Reviewing files that changed from the base of the PR and between 5eb33a5729178170103405af0c852ea8809e5463 and 9e7de4f3490a4716bb55a85fec209d467d2be4d2.
📒 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; 4 remain after this review.
-
📝 Walkthrough
-
Managed Codex launch arguments now include
agents.enabled=false. A test asserts that the launch arguments include this setting.Changes: Codex managed runtime
Layer / File(s) Summary Disable agents and verify launch arguments
apps/server/src/provider/CodexManagedRuntime.ts,apps/server/src/provider/CodexManagedRuntime.test.tsManaged launch arguments add agents.enabled=falsealongside the existing multi-agent feature flags. The test asserts that the launch arguments include the new setting.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
connwalk
Merge Risk: ⚪ Minimal · up to
9e7de-
Managed Codex launches now disable native agents while preserving ordinary code execution. The PR reports that this works with Codex 0.163.0; no concrete merge-blocking risk is established in the supplied evidence.
Security architecture risk: ⚪ Minimal · up to
9e7de-
The change adds a restriction to managed launches without expanding credentials, access, or deployment scope. No material security risk introduced or worsened by this change was identified.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- inferred — The changed control is scoped to managed launches. The comparison adds no credential recipient, network destination, privileged operation, or broader non-managed caller.
Trust Boundaries and Controls
- observed — The restrictive setting is server-owned. Existing environment handling removes T3CODE_CODEX_LAUNCH_ARGS, OPENAI_API_KEY, and OPENAI_BASE_URL before returning the managed environment; both existing multi-agent disable flags remain in place.
-
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: disabling agents for ChatGPT sharing in Codex. Linked Issues check The change addresses the coding requirement in active issue [ #21061].CodexManagedRuntime.tsaddsagents.enabled=falseto the managed launch overrides while preserving both multi-agent feature fla…Out of Scope Changes check The pull request changes only the managed Codex launch configuration and its regression assertion. These changes directly implement [ #21061]. No client, contract, local/API-key path, conversation-hist…Description check The description provides the problem, implementation, scope, linked issues and pull requests, approval status, detailed verification results, limitations, and implementation details. It does not use t… Full details: Linked Issues check
-
Explanation
The change addresses the coding requirement in active issue [
#21061].CodexManagedRuntime.tsaddsagents.enabled=falseto the managed launch overrides while preserving both multi-agent feature flags. This prevents catalog-selected native agents on the managed ChatGPT sharing path.CodexManagedRuntime.test.tsasserts the override for primary and additional accounts and for managed and local executable cases. The reported live check also confirms that the six native-agent tools are absent while code execution remains available. The issue's closed related report [#17679] supplies context only.
Full details: Out of Scope Changes check
-
Explanation
The pull request changes only the managed Codex launch configuration and its regression assertion. These changes directly implement [
#21061]. No client, contract, local/API-key path, conversation-history migration, or unrelated product behavior changes are present in the reviewed diff.
Full details: Description check
-
Explanation
The description provides the problem, implementation, scope, linked issues and pull requests, approval status, detailed verification results, limitations, and implementation details. It does not use the template headings, but it contains the required information and is sufficiently complete.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge assignedjuliusmarminge
Taking over this one for batch codex-01. I will keep the managed-sharing agent restriction focused, merge current main, rebuild the minimum regression coverage, and run independent reviews before pushing here. The PR will remain unmerged for human approval of the behavior change.
pirut(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 — This focused fix changes the default behavior of managed ChatGPT-sharing Codex sessions by disabling native agents across their launch paths. The change is small and tested, but product-default changes require human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).