[mcp] fix: classify list_gpus enumeration unavailability - #224
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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)
📝 WalkthroughWalkthroughThis PR maps ChangesMCP list_gpus startup-unavailable classification
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant MCPServer as MCP Server (_call_keepgpu_method)
participant GPUInfo as get_gpu_info
Client->>MCPServer: list_gpus request (JSON-RPC or tools/call)
MCPServer->>GPUInfo: get_gpu_info()
GPUInfo-->>MCPServer: raise DeviceEnumerationUnavailableError
alt Direct JSON-RPC
MCPServer-->>Client: error code JSONRPC_STARTUP_UNAVAILABLE
else MCP tools/call
MCPServer-->>Client: result.isError=true, startup-unavailable message
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Summary
DeviceEnumerationUnavailableErrorfrom direct JSON-RPClist_gpusas startup-unavailable (-32000) instead of internal error.tools/call list_gpusenumeration failures as tool errors (result.isError=true) while preserving malformed listing payloads as internal contract errors.Local review
list_gpusrecords remain internal errors and unexpected MCP tool failures still return JSON-RPC-32603.Verification
-32603and MCP top-level protocol error.PYTHONPATH=$PWD/src pytest tests/mcp/test_server.py::test_jsonrpc_list_gpus_device_enumeration_unavailable_returns_public_code tests/mcp/test_server.py::test_mcp_tools_call_list_gpus_device_enumeration_unavailable_returns_tool_error -q: 2 passed.PYTHONPATH=$PWD/src pytest tests/mcp/test_server.py -q -k 'list_gpus or startup_unavailable or tools_call': 26 passed, 109 deselected.PYTHONPATH=$PWD/src pytest tests/mcp tests/utilities/test_gpu_info.py -q: 300 passed, 1 skipped.PYTHONPATH=$PWD/src pytest -q: 845 passed, 11 skipped.PYTHONPATH=$PWD/src mkdocs build --strict: passed with the existing Material for MkDocs upstream warning.pre-commit run --all-files --show-diff-on-failure: passed.git diff --check: passed.Summary by CodeRabbit
Bug Fixes
Documentation
Tests