Skip to content

refactor: remove two Codex patches for MCP calls and tool results - #6092

Merged
markstuart-oai merged 1 commit into
feat/codex-harnessfrom
codex/python-consolidate-native-patches
Nov 19, 2026
Merged

markstuart-oai merged 1 commit into
feat/codex-harnessfrom
codex/python-consolidate-native-patches

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Why

The Python SDK has been carrying two Codex patches to raise a Rust build limit and add two names to a tool check. This PR removes both by moving one existing box in the MCP client and sharing one tool check across the engine and the Python binding.

Summary

  • 009 raised the limit after Rust hit a query depth of 130 for the MCP handler. Boxing the whole tools/list call keeps the build within the stock limit of 128. The first successful attempt still uses one box. Retries share it. An early error can now allocate the box before the first attempt.
  • 029 added project_glob and project_grep to the tools whose results the host can filter. The profile already checks for all five tool names in the default namespace. Core now uses that check before it asks any contributor to handle the result. The Python binding uses the same check for tool selection and result handling.

The series drops from 110 engine patches to 108 at the same Codex pin. It keeps the three RMCP patches, bringing the total from 113 to 111 patch files.

Test plan

I built release wheels for the base (7629523b) and this commit (604e01a9) in separate, empty Cargo target directories. Both used the same toolchain and profile. I traced each changed Rust file through the build and checked the hash of the native library each caller loaded. All test bodies in the patched source match the base.

  • The full repo check passed on the base and on a solo retry of this commit. It covers format, lint, type checks and make tests. Both had 12,872 passes and 105 skips, with the same test IDs and skip reasons.
  • The direct installed suite passed the same 12,872 tests on each wheel. It logged 112 skips per wheel because the serial command collects the full tree again.
  • Both wheels passed nine strict Docker tests, three tests with the Chromium sandbox on, and seven live examples. These covered tool calls, approval, MCP and Realtime audio. MCP also passed on Python 3.10. Public callers checked result filtering, history and trace ownership.
  • The MCP client and extension API passed 300 Rust tests with one ignored on each build. The Python binding had the same seven failures out of 344 on both. The upstream core and MCP test targets had the same build errors, including missing fields in test fixtures.

Failures and retries

  • The eighth live example, retained_compaction, passed five times and failed twice on each wheel. Both failed before restore, when the SDK tried to match a reasoning item to its saved form. A local provider reproduced the error on both with content: []. Both passed when the provider sent null or omitted the field. In separate live checks, the field was absent from the failing snapshots on both wheels. The raw provider response is unknown.
  • The lost start reply test failed in the first full repo check on this commit. In 20 runs per wheel, the same assertion failed four times on the base and twice on this commit. Both raised the expected NativeError when the caller cancelled as soon as the reply was lost. With a 50 ms delay, cancellation returned and session close raised RuntimeError. Each outcome held in all ten trials per wheel.
  • During concurrent builds, a history test timed out on the base and a model call timed out on this commit. Each test then passed ten times per wheel.

An earlier run used wheels built with warm Cargo caches and a read-only base checkout. It had 106 failures on the base and 108 on this commit. Four cases differed. The receipt check passed with each wheel's own manifest. The steering test read an empty heartbeat file once on this commit, then passed 20 times per wheel. The zero-second history expiry and lost start reply tests failed on both in repeated runs.

Issue number

None.

Checks

  • I've added new tests, if relevant
  • I've run the applicable checks in AGENTS.md, including .agents/skills/code-change-verification/scripts/run.sh when required
  • I've confirmed all required checks pass
  • I've completed the review required by AGENTS.md

@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 19, 2026 10:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T10:15:25.751393Z 604e01a PR opened
🔒 Security Review ✅ Completed 2026-11-19T10:16:29.825778Z 604e01a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@markstuart-oai
markstuart-oai removed request for a team, rm-openai and seratch November 19, 2026 10:20

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete patch-series changes and surrounding MCP retry/timeout handling and native interception. Moving the existing box around the complete tools/list operation preserves execution and cancellation behavior. The shared predicate retains the same five default-namespace executor tools across Core policy, profile permissions, and Python interception. No actionable findings after coordinator and independent static review.

Hosted CI: 37 successful checks, 9 skipped. No candidate code or local tests executed.

@markstuart-oai
markstuart-oai merged commit 707a4c5 into feat/codex-harness Nov 19, 2026
48 checks passed
@markstuart-oai
markstuart-oai deleted the codex/python-consolidate-native-patches branch November 19, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants