Skip to content

fix(mcp): complete wide retained occurrence inventories - #10356

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
codex/n13-0938-occurrence-completion-8545
Nov 13, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
codex/n13-0938-occurrence-completion-8545

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

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 exceeded before 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.

  • New regression on base: small control passes; wide case fails with the MCP protocol error. It uses real graph authentication, ledger admission, BinarySession, server registration, and the official client over InMemoryTransport. Inventory facts are explicitly synthetic; no actual ZIP contents or real provider behavior are claimed.
  • Fresh main-thread child processes reproduce the stdio server's argument capacity. Their 4096-MiB heap request accommodates the ledger's conservative admission; the observed wide representation estimate is 337,752,826 bytes. The fix does not change admission.
  • 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 --check passed.
  • Wide stdio transport and Linux/Windows were not exercised locally. GitHub Actions checks at a160094bb5b9f38f305230bf9c8acb9e1c0fe2f4 completed 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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The author is exempt from the declaration check under CONTRIBUTING.md. This draft does not attest that human review occurred.

The separate PR readiness commit status remains pending while this PR is a draft.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Low impact] The PR appears safe to merge; no blocking issue was found.

Summary

Replaces the data-sized function-call spread in promptCompletion.ts with ordered appends, avoiding the call-argument limit without changing inventory interpretation.

  • Occurrence completion now returns results for very wide retained inventories.

Reviews (2) · Last reviewed commit: "fix(mcp): complete wide retained occurre..." · Reviewed by Greptile

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T14:10:07.392211Z a160094 Draft marked ready
ℹ️ 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.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit 26b70c8 into main Nov 13, 2026
53 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the codex/n13-0938-occurrence-completion-8545 branch November 13, 2026 14:17
@morluto morluto added area: mcp MCP server, transport, and tool registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants