[mcp] fix: return jsonrpc parse error envelopes - #122
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough
ChangesJSON-RPC Parse Error Envelope
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the HTTP POST handler to return standard JSON-RPC parse error envelopes (with error code -32700 and HTTP status 200) for malformed requests sent to the / and /rpc endpoints, while keeping REST-shaped HTTP 400 errors for other routes. The changes include updates to documentation (AGENTS.md, docs/guides/mcp.md), a new implementation plan, and a parameterized test to verify the new behavior. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
-32700 Parse errorenvelopes for malformed HTTP JSON-RPC bodies on/and/rpc./api/sessionsmalformed-body errors as structured HTTP 400 responses.Test Plan
PYTHONPATH=$PWD/src pytest tests/mcp/test_http_api.py::test_http_jsonrpc_parse_error_returns_jsonrpc_envelope -qfailed because/rpcreturned HTTP 400.PYTHONPATH=$PWD/src pytest tests/mcp/test_http_api.py::test_http_jsonrpc_parse_error_returns_jsonrpc_envelope -q-> 2 passed for/and/rpc.PYTHONPATH=$PWD/src pytest tests/mcp/test_http_api.py -q-> 51 passed.PYTHONPATH=$PWD/src pytest tests/mcp -q-> 142 passed.PYTHONPATH=$PWD/src pytest tests -q-> 474 passed, 11 skipped.pre-commit run --all-files-> passed.PYTHONPATH=$PWD/src mkdocs build-> passed with existing MkDocs/material and unnav warnings.git diff --check origin/main..HEAD-> passed.Local Review
Summary by CodeRabbit
Bug Fixes
id: null.Documentation