fix(mcp): suppress JSON-RPC notification responses#795
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe MCP request handler now treats JSON-RPC requests missing an "id" as notifications: it returns an empty HTTP 202 Response for those notification-style requests (including ChangesMCP notification handling
Possibly related PRs
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6d9d4333-a996-4619-b0f0-1cb507f9055c
📒 Files selected for processing (2)
app/mcp.pytests/test_api_mcp.py
135cb58 to
a73cd0e
Compare
jakerated-r
left a comment
There was a problem hiding this comment.
Reviewed current head a73cd0e06fbbc0c2dd6898944a6f3a9d6704a29c as a non-author current-head review.
No blocker found in the MCP JSON-RPC notification handling.
Evidence checked:
- inspected
app/mcp.pyand confirmed notification detection is based on presence of theidmember rather than truthiness, so requests with explicit"id": nullstill receive normal JSON-RPC responses while true notifications do not; - confirmed notification paths now return an empty HTTP
202response fortools/list, successfultools/call, unknown methods, invalid params, invalid tool names, invalid arguments, and tool errors; - inspected
tests/test_api_mcp.pyand confirmed coverage for notification payloads across success and error paths; - verified the earlier CodeRabbit pre-merge warning about
204is addressed on this head: the code and test now use202.
Validation run locally:
.venv/bin/python -m pytest tests/test_api_mcp.py -q->106 passed, 1 warning;.venv/bin/python -m pytest -q->679 passed, 1 warning;.venv/bin/python -m ruff check app/mcp.py tests/test_api_mcp.py-> passed;.venv/bin/python -m ruff format --check app/mcp.py tests/test_api_mcp.py-> passed;.venv/bin/python -m mypy app-> passed;git diff --check origin/main...HEAD-> passed;git merge-tree --write-tree origin/main HEAD-> clean treed2846ec462e8e7e1c0c184becb45604c9274390a.
Hosted quality/readiness/docs/image check is green. GitHub still shows CodeRabbit pending on the latest head at review time, so I am treating that as the only remaining external status caveat rather than a code blocker.
|
Maintainer queue hold: #656 currently has 0 effective awards remaining because the final slot is covered by pending proposal #118. This PR is not accepted or payable under #656 in this state. The successor issues #798/#799 are still pending |
Summary
idmember is presentRefs #656
Report: #656 (comment)
Validation
python -m pytest tests/test_api_mcp.py -q-> 106 passed, 1 warningpython -m pytest -q-> 679 passed, 1 warningpython -m mypy app-> successruff check app/mcp.py tests/test_api_mcp.pyruff format --check app/mcp.py tests/test_api_mcp.pygit diff --checkSummary by CodeRabbit
Bug Fixes
Tests