Repository navigation
fix(mcp): preserve input validation issue attribution - #7981
Conversation
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. |
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryPreserves rejected field paths and constraints in SDK input errors, with separate validation facts for each request.
DiagramsequenceDiagram
participant Client
participant Transport as ErrorEvidenceTransport
participant SDK
participant Schema
Client->>Transport: tools/call with request ID
Transport->>SDK: Dispatch with a separate validation context
SDK->>Schema: Validate arguments
Schema-->>SDK: Return issues and capture them for this call
SDK->>Transport: Return validation error
Transport->>Transport: Bound field detail and place SDK explanations
Transport-->>Client: Field error or bounded recovery response
Reviews (6) · Last reviewed commit: "merge: integrate main into SDK input att..." · Reviewed by Greptile |
Keep field-level validation issue attribution and main's exact input-element refusal when both rewrite the SDK error normalizer. Co-authored-by: morluto <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
morluto#7905 bounds MCP arguments at 1,024 elements by default, which two inline ESP flash-dump inventories exceed, so the ESP flash comparison test now compares the Evidence its session retained. morluto#7981 reports an input issue at its field path with zod's reason, so the Rizin decoder-input refusal is `invalid_format` at `asm_cpu`.
Problem and change
Fixes #7661. SDK validation errors could replace rejected field paths with a root issue, including for concurrent requests. Request-scoped validation facts now preserve the field-level issues for the matching response. Projection is charged before allocating nested and repeated paths; when the detail allowance is exhausted, the result explicitly reports omitted field detail and retains the SDK diagnostic.
This addresses ordinary input diagnostics, which #7905 explicitly leaves outside its input-admission scope. The SDK still constructs its own validation issues before this projection; the allowance is not a process-memory cap.
Validation
npm run check:fast,npm run docs:check, andgit diff --checkpassed. Independent review identified and verified fixes for nested and repeated-path accounting.Review follow-up: the fallback retains the SDK diagnostic once and records omitted field detail as a structured fact. The tests compare the full diagnostic against an unwrapped SDK response, cover a long unknown key, and assert exact concurrent issue lists. The branch includes current main; 33 focused tests,
check:fast,format:check, andgit diff --checkpassed. Independent review found no further material issue.CI follow-up: four MCP tests that asserted the prior flattened SDK errors now check the structured issue paths and reasons. All 24 affected tests,
check:fast, andgit diff --checkpassed; independent review confirmed the existing failure and provider-launch controls remain.Additional CI follow-up: the browser-scenario full and compact MCP assertions now check the structured path, reason and bound instead of the old flattened diagnostic. Both cases,
check:fast, andgit diff --checkpassed; independent source review confirmed the CLI and MCP controls remain.CI follow-up on
5ffd64410: SDK diagnostic fragments are attached to their producing issue or retained in the residual summary once, including mixed custom and expanded union cases; the complete diagnostic is not always one contiguous string. Source-aligned projection avoids misattribution when union and sibling issues share a path. Fifty-two focused tests,check:fast,docs:check, andformat:checkpassed. Independent source review found no further concrete defect.Author readiness
Human owner: @morluto