Repository navigation
perf(mcp)!: defer retained views in progressive catalogs - #9151
Merged
Merged
Conversation
Keep full schemas and canonical analysis unchanged while loading the cross-domain view through existing named discovery. Qualify real recent-tool workflows with token ledgers, latency, CPU, family RSS and retained-follow-up controls. BREAKING CHANGE: The opt-in hot-cold catalog no longer preloads inspect_analysis_view. Discover it before calling it, batch with its producer when needed, or use the unchanged default full profile.
Contributor
[Medium impact] The PR appears safe to merge with the documented discovery requirement for SummaryThis PR makes
Review limits: Tests were not run during this review. GitHub access required authentication, so supersession could not be checked. DiagramsequenceDiagram
participant Client
participant Catalog
participant Analysis
participant Evidence
Client->>Catalog: Discover producer
Catalog-->>Client: Refresh available tools
Client->>Analysis: Request selected facts
Analysis->>Evidence: Retain complete result
Analysis-->>Client: Selected facts and parent Evidence ID
Client->>Catalog: Discover inspect_analysis_view
Catalog-->>Client: Original complete contract
Client->>Analysis: Query retained parent
Analysis->>Evidence: Read retained facts
Analysis-->>Client: Selected follow-up facts
Reviews (2) · Last reviewed commit: "perf(mcp)!: defer retained views in prog..." · Reviewed by Greptile |
3 tasks done
This was referenced Nov 8, 2026
Nabab-Hub
pushed a commit
to Nabab-Hub/rea
that referenced
this pull request
Nov 12, 2026
Nabab-Hub
pushed a commit
to Nabab-Hub/rea
that referenced
this pull request
Nov 17, 2026
Nabab-Hub
pushed a commit
to Nabab-Hub/rea
that referenced
this pull request
Nov 19, 2026
Nabab-Hub
pushed a commit
to Nabab-Hub/rea
that referenced
this pull request
Nov 29, 2026
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.
Summary
An inline OpenAPI/GraphQL/trace/endpoint query was paying for the unused cross-domain
inspect_analysis_viewdefinition. MCP JS SDK 2.3.1 eagerly prepares output validators for its discovered catalog, adding several seconds before these first answers.Load the view on demand through the existing hot/cold catalog owner. No new cache, tool, execution gateway or parser path. Full schemas and canonical validation remain intact when loaded. The default
fullcatalog is exactly unchanged (241 tools / 4,257,977 bytes on the rebased main).Follow-up qualification of #9090, #9104, #9127, #9140 and #9143. The report and JSON receipt retain ranges, digests and limitations.
Observed results
Three alternating suite repetitions, real small/large artifacts, normal JIT and stock SDK validation. Measurements use exact-name discovery; broad keyword discovery can also load the generic view and is not qualified for the same speedup. Initial hot/cold catalog: 781,713 → 90,374 bytes. Five inline-only tasks return identical analysis Evidence:
Token estimates use tiktoken 0.14.0/o200k_base and count distinct input definitions, instructions, a fixed question, every argument and text reply. They are not actual model usage. Output schemas are counted separately as transport costs. No model calls or billing claims.
Six-case suite including retained follow-ups and all client/server cleanup: median wall 70.618 → 46.181 s, user+system CPU 75.316 → 47.741 s, sampled family peak RSS 1,195,388,928 → 1,046,691,840 bytes. Two CPU affinity, 4 GiB RSS guard/200 ms sampling, 1 GiB Node heaps; no compared run hit a guard. Filesystem caches were not flushed; later cases share warm harness/SDK code.
Tradeoff: later discovering the generic view adds a call and catalog refresh. That cohort slowed from 10.78 to 12.79 s and has no incremental-token benefit. Two cold-client batched controls avoid the extra discovery/refresh but establish no speedup; timing ranges overlap. This changes unused-schema costs, not artifact parsing speed. Model rendering/caching, reasoning, cold disk, other clients and sustained generic large-page JIT behavior remain unmeasured.
Validation performed
npm run docs:buildandnpm run docs:check— passed, including 9 README consistency checks. Later edits clarify cache scope and add the integration record without changing links.fbe7532fabb78de46bd00db845c1147b5325ad22; analysis Evidence digests match the qualified cohort. A same-base comparison confirms default-full exact equality; the upstream managed schema difference is kept separate from this optimization.Independent oracles check original OpenAPI declarations, GraphQL source-line containment/digests, raw ZIP network records and the previously qualified OpenWrt byte ranges/hashes. Every paired analysis Evidence digest matches. Original trace/HAR captures and raw measurement harnesses remain local outside Git; exact real-data timing reproduction requires matching external fixtures. The public regression is self-contained.
Compatibility and scope
BREAKING CHANGE: In the opt-in
hot-coldcatalog,inspect_analysis_viewis no longer initially loaded. Discover it before calling it; batch it with its producer when follow-ups are known. Clients that require upfront availability can keep the unchanged defaultfullprofile. CLI contracts, arguments, results, Evidence, caller selection, authority and complete export are unchanged.The public stdio regression discovers an API producer, verifies selected facts without loading the generic view, removes its owned source file, then discovers the view with the complete canonical schema, queries retained facts and exports complete source Evidence. Related stdio/HTTP reset/doctor tests use policy or observed inventory/deltas rather than hardcoded catalog counts.
No target execution, provider installation, package/dependency changes or new mutation authority. Maintainer execution/mutation scope decision: not applicable. No binary fixtures or credentials committed.
Author readiness
Human owner: @gensokyo-dev (repository declaration exemption applies).