Repository navigation
fix(mcp): name the reason on MCP route 400 log lines - #10475
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryAdds reasons to existing MCP error logs without changing response bodies.
No new actionable issues found. Tests were inspected but not run during this review. Reviews (4) · Last reviewed commit: "fix(mcp): pass a route context in the te..." · Reviewed by Greptile |
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. |
waleedlatif1
force-pushed
the
fix/search-mcp-400-reason
branch
from
November 28, 2026 11:44
25f47dd to
908ee55
Compare
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 was referenced Nov 28, 2026
This branch was successfully 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
Client error responseline throughdescribeResponseError, so client incompatibility can be told apart from noise. Response bodies are unchanged.serveStatelessMcpreads the reason only when the SDK transport refuses a request (status >= 400):errorCodeis the JSON-RPC code.errorReasonis the SDK message with any dynamic tail dropped, e.g.Bad Request: Unsupported protocol version.errorDetailis themcp-protocol-versionheader capped at 40 chars, set only when that version was the cause./api/mcp) passMCP_PARSE_ERROR_RESPONSEStoparseRequest. A contract validation failure is logged with its field and issue kind (a JSON-RPC batch isbody/invalid_type), and invalid JSON asinvalid_json. Both still render the default 400 bodies.v2ValidationErrorand the MCP renderer now share onedescribeValidationError, so the v2 summary is the same as before.Type of Change
Testing
route-handler.protocol.test.tsdrives the real route, SDK transport and Search MCP server. It checks the logged reason for an unsupported protocol version and for a batch body. Each test failed when its guard was reverted.lib/knowledge/mcp/route-handler.test.ts,lib/api/mcp/route-handler.test.ts,app/api/v2/lib/*.test.tsandlib/api/server/validation.test.ts; all pass. Biome is clean on the changed files.Checklist
test-auditauthoring gate)