Repository navigation
fix(mcp): provide native evidence paging continuation - #1910
Conversation
Include schema-validated inspect_analysis_view arguments when retained analyze_function Evidence exceeds the response budget. Preserve complete Evidence and require acknowledged retention. Refs morluto#1849. Verified with 28 focused MCP tests, npm run check, and npm run docs:check; real native providers were not run.
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 830eee209e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .parse(parseMcpToolError(detached)).error.details.reported_limits; | ||
| expect(detachedLimits).not.toHaveProperty("continuation"); | ||
| expect(detachedLimits).not.toHaveProperty("evidence_reference"); | ||
| const failed = delivery.toEvidenceToolResult( |
There was a problem hiding this comment.
Drive the initial failure through the MCP transport
In this MCP-boundary case, the initial oversized analyze_function failure is manufactured by calling ToolResultDelivery.toEvidenceToolResult directly, so it never traverses the registered producer handler, session-recording wiring, SDK error handling, or ErrorEvidenceTransport; only the later continuation calls use client.callTool. A regression that removes or rewrites details.reported_limits.continuation before it reaches an MCP client would therefore leave this test green. Return the large dossier from the test provider and obtain this first failure via a public analyze_function call instead.
AGENTS.md reference: AGENTS.md:L44-L44
Useful? React with 👍 / 👎.
…dence-continuation
Obtain oversized analyze_function failures through the registered Ghidra adapter and MCP client, then page acknowledged session Evidence without further provider calls. Repair upstream tool-effect wording audit exceptions for static WASM and Harmony inventory tools. Validation: 28 MCP boundary tests, 5 tool-effects tests, check:fast and docs:check passed. Real Ghidra was not run.
Preserved caller paths make page envelopes depend on checkout and temporary directory length. Replace an arbitrary 12000-byte assertion with the pinned stdio receive-buffer bound, retaining exact source, offset and retention checks. The unchanged 64-unit page is 12017 bytes in an isolated worktree. Refs morluto#1849 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
|
Local review found a directory-dependent test failure on head Follow-up commit |
Summary
Give callers a ready-to-call pseudocode page when completed native function Evidence exceeds MCP delivery capacity. Preserve the complete canonical record and only offer continuation after session recording is acknowledged.
Fixes #1849.
Problem and expected behavior
An oversized
analyze_functionresult already retains useful Evidence, but generic export advice leaves callers to reconstruct the supported view request. The error should supply exact arguments for the existing bounded source view, without silently replacing or truncating the requested full result.Change and scope
Attach a named, schema-validated
inspect_analysis_viewcontinuation to the completed-result transport error. Start at offset zero with the existing 64-unit default, then followcoverage.next_offset. Keep export advice and explain that arbitrary source or metadata can still require a smaller limit or export. The follow-up regression checks the pinned SDK receive-buffer bound rather than a fixed 12,000-byte envelope; preserved caller paths make envelope size depend on the local directory.Contract and boundary impact
details.reported_limits.continuationand actionable remediation; reuse the existing named input contract. CLI behavior and advertised operation schemas are unchanged.docs/public/product-catalog.json), package, or installation impact: owning MCP documentation updated; no dependency, installer or authored catalog-schema change.Evidence and regression coverage
92817465falso reproduced a path-dependent assertion: a correct 64-unit page serialized to 12,017 bytes, exceeding an arbitrary 12,000-byte test threshold. Follow-upd0aedf63euses the actual protocol bound.reported_limits.continuation.nameisinspect_analysis_view; its arguments contain the reported retained reference and{kind: "native", facet: "pseudocode", offset: 0, limit: 64}. The next page uses the returned offset.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/mcp/analysisViewMcp.test.ts tests/boundary/mcp/toolResult.test.ts src/server/toolResultEncoding.test.ts— 28 passed across 3 files, including the follow-up on an isolated long-path worktree.npm run check— passed, including typecheck, lint, formatting, metadata/unused-code checks and architecture guards.npm run docs:check— passed.0x41bf30: full result exceeded the 10,485,760-byte receive buffer (at least 10,512,118 bytes). Used the supplied continuation directly: first/second responses each 28,863 bytes, exact 64-unit source slices, next offsets 64/128. Export verified the complete 39,225 UTF-16-unit pseudocode and original selected procedure/digest. Ping, explicit close and unchanged target bytes passed.Compatibility, safety, and release
Review checklist
type(scope): outcome.