Repository navigation
fix(mcp): record deferred schemas before protocol framing - #9351
Merged
Merged
Conversation
Contributor
[Medium impact] The reviewed changes appear safe to merge; no blocking code issue was found. SummaryRecords canonical output schemas before the SDK applies protocol-specific framing.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
C[Canonical output schema] --> R[Catalog recorder]
R --> J[Pre-framing JSON Schema]
J --> D[Deferred SDK registration]
C --> V[Canonical output checker]
V --> D
D --> S[SDK applies negotiated framing]
S --> A[MCP client]
Reviews (4) · Last reviewed commit: "test(mcp): verify deferred parity and ca..." · Reviewed by Greptile |
This was referenced Nov 8, 2026
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 12, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fresh default full-catalog connection advertises a legacy
{result: ...}wrapper forsearch_guidance, but deferred materialization returns the canonical union object. The stock SDK rejects it before an agent can read guidance. This blocks the on-demand guidance work in #9347.Record output projections before protocol framing. The SDK owns root wrapping for both listings and replies; deferred registrations retain canonical validation and the recorded schema. No target/provider behavior, authority or cleanup policy changes.
Validation
Runtime CI passed at
9304152a9; human author readiness remains pending.Current head
9304152a9, Node 24.22.1 / npm 11.16.0 / macOS arm64:npm run check:fastand touched formatting/diff checks pass.72d5e72e6with the missing-resulterror. Two independent combined-workflow negative controls in perf(mcp): disclose retained-view guidance on demand #9353 reproduce the same failure before any compiled-guide lookup.Combined qualification with #9353: 12 public stdio configurations cover legacy/modern, full/compact/off output advertisements, full/hot-cold catalogs and pairwise full/compact inputs. Two additional cases hold real deferred initialization, cancel one request, complete a peer, verify only the peer's Evidence was recorded, reconnect, and recover portable Evidence. Four further cases verify malformed-first-call recovery and lazy-module failure behavior on those same legacy/full and modern/hot-cold configurations. Two prompt-first cases additionally verify prompt-driven materialization and live retained-Evidence completion. Two runtime-copy cases additionally exercise stale/unavailable guidance union members, malformed locators, and recovery after restoring the bundle. All 22 pass. Modern refresh uses a real
subscriptions/listensubscription; legacy uses unsolicited notifications. This is a representative matrix, not the exhaustive 24-cell product.Legacy advertisements remain compared with the canonical generated catalog. Modern listings retain pre-codec projections. Successful union results, errors without structured success payloads, malformed compact inputs, repeated discovery and retained views all preserve their declared behavior.
Current-main qualification: #9353 head
454d7121fcombined with pinned mainc78c8aed4in an unpublished worktree passes 79 MCP boundary and 53 source cases, including this PR's 35 public stdio cases and eager/deferred schema comparisons. Build, typecheck/lint and documentation checks pass. Missing generated test metadata initially blocked two suites; the focused runner prepared it before both suites passed. No combined CI claim; reproduction and limitations are recorded in #9353.The once-dispatched combined CI at #9353 head
17e8deebfpassed all 22 deferred cases but failed one guidance-search rank assertion; the current-head correction and its passing 28-case focused/acceptance validation are recorded at #9353ed307b8d5. The real Apple job was cancelled at its workflow bound, so no full-run pass is claimed.Related history: #7127, #9046, #9151, #7228. Scope decision: not applicable; existing schema presentation only. No token/latency saving claimed for this prerequisite. Real deep providers and other host platforms were not exercised.
Author readiness
Human owner: @kaoru0822-kitauji