Repository navigation
improvement(search): run Search MCP calls whose arguments have one reading, and log rejected ones - #9814
Merged
Conversation
…ading, and log rejected ones
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new blocking issue remains. SummaryThe PR repairs clearly intended Search MCP arguments before SDK checks and logs repairs and rejected inputs without argument values.
Reviews (2) · Last reviewed commit: "fix(search): look up tool schemas by own..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…der IDs to source
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
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
MCP error -32602, spends another round, and nothing is logged on our side. The Search MCP route now rewrites search arguments that fail the schema but have exactly one reading, before the SDK validates them:nativeQueries: []→ omittednulloptional native query field (e.g.kind: null) → omittedproviderthat names a provider → thesourcefilter (whensourceis absent or the same); any other value is still rejectedstartDate,endDate,modifiedAfter,modifiedBefore,sortBy,topK) that every native query carries with the same value → the search's own filterKnowledge MCP tool input repaired(which repairs) andKnowledge MCP tool input rejected(field paths and issue codes, no values), so rejected calls become visibleType of Change
Testing
lib/knowledge/mcp/route-handler.protocol.test.tssends JSON-RPC through the real route, SDK transport and Search MCP server: each repair fails on the base and passes here (each guard reverted and watched go red), both ambiguous-filter cases and a provider value that names no provider stay rejected, and calls to inherited-name tools (constructor,toString,__proto__) get an MCP error, not a 500bunx vitest run lib/knowledge/mcp(60 passed), biome on changed files; type-check and audits in CIChecklist
test-auditauthoring gate)🤖 Generated with Claude Code