Repository navigation
fix(mcp): complete wide retained occurrence inventories - #10356
Merged
kaoru0822-kitauji merged 1 commit intoNov 13, 2026
Merged
Conversation
2 tasks done
Contributor
[Low impact] The PR appears safe to merge; no blocking issue was found. SummaryReplaces the data-sized function-call spread in
Reviews (2) · Last reviewed commit: "fix(mcp): complete wide retained occurre..." · Reviewed by Greptile |
This was referenced Nov 13, 2026
kaoru0822-kitauji
marked this pull request as ready for review
November 13, 2026 14:08
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. |
kaoru0822-kitauji
deleted the
codex/n13-0938-occurrence-completion-8545
branch
November 13, 2026 14:17
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.
Refs #8545. Separate owner from #10355 and the other submitted wide-inventory fixes; earlier #8568 and #3292 are closed/unmerged.
Problem and change
An authenticated inventory with 130,001 occurrences passes graph validation and ledger admission, but requesting occurrence completion throws at a data-sized call spread. The official MCP client receives
ProtocolError: Maximum call stack size exceededbefore the server can return its 100-value completion page.Append candidates by ordered iteration in
promptCompletion.ts. Keep the existing inventory reader as semantic owner; prefix normalization, deduplication, complete candidate examination, totals, and pagination remain unchanged. No new cap, cache, tool/schema, metadata, provider, target execution, or mutation authority. Routine correctness fix; advance maintainer scope approval is not applicable.Executed verification
Base:
bbe2bcc979be747698d9ad9ce87af017b92e0f10, macOS arm64, Node 24.22.1 / npm 11.16.0.BinarySession, server registration, and the official client over InMemoryTransport. Inventory facts are explicitly synthetic; no actual ZIP contents or real provider behavior are claimed.npm run test:focused -- tests/boundary/mcp/wideOccurrenceCompletion.test.ts tests/boundary/mcp/promptCompletion.test.ts tests/boundary/mcp/promptMcp.test.ts tests/boundary/mcp/completionInventoryAliasMcp.test.ts— 35 tests passed in 4 files. New cases assert all 130,001 candidates are counted, exactly 100 sorted values are returned, and an exact prefix beyond that page still resolves. Existing cases cover invalid inventories, merged pages, aliases, duplicates, reset/close behavior, and unavailable providers.npm run check— passed; typed lint: 7,253 files, 0 errors, 4,987 advisory warnings.npm run verify:test-discovery— 3,507 test files exactly once.git diff --checkpassed.a160094bb5b9f38f305230bf9c8acb9e1c0fe2f4completed with 23 successful checks, 24 skipped, none failed or pending. Human review remains outstanding.Cost control: identical 1,000-child fixture/protocol tasks took 73.1 ms before / 72.5 ms after, measured after imports in fresh processes (one sample each). Whole-process CPU including startup was 1.936 s / 1.298 s; cumulative Node peak RSS was 539.0 MiB / 405.5 MiB. Cache/host load were uncontrolled, so no speedup is inferred. Agent tokens, process-family peak, cold startup latency and warm-process variance were not measured. The admitted wide case has no completed base run to compare.
Author readiness
Human owner: @kaoru0822-kitauji
The author is exempt from the declaration check under CONTRIBUTING.md. This draft does not attest that human review occurred.
The separate
PR readinesscommit status remains pending while this PR is a draft.