[mcp] fix: classify startup unavailable errors - #128
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 (8)
📝 WalkthroughWalkthroughAdds a ChangesController Startup Unavailable Error Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 introduces explicit, parseable error handling for expected controller startup unavailability, such as unsupported platforms or no visible GPUs. It defines custom exceptions (including ControllerStartupUnavailable, NoGPUAvailableError, UnsupportedControllerPlatformError, and SessionStartupUnavailable) and maps them to specific error responses: JSON-RPC -32000, REST HTTP 503, and MCP tool isError=true. Comprehensive unit tests and documentation updates have been added to verify and document these changes. There are no review comments, and we 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
GlobalGPUControllerstartup unavailability with controller-domain exceptions-32000, REST503, and MCP toolisError=trueAGENTS.md, MCP/CLI docs, and the implementation planVerification
PYTHONPATH=$PWD/src pytest tests/mcp/test_server.py::test_jsonrpc_start_keep_startup_unavailable_returns_public_code tests/mcp/test_server.py::test_jsonrpc_start_keep_unsupported_platform_returns_public_code tests/mcp/test_server.py::test_jsonrpc_start_keep_zero_visible_gpus_returns_public_code tests/mcp/test_server.py::test_jsonrpc_start_keep_runtime_value_error_remains_internal_error tests/mcp/test_server.py::test_mcp_tools_call_startup_unavailable_returns_tool_error tests/mcp/test_http_api.py::test_http_post_sessions_startup_unavailable_returns_json_503 tests/mcp/test_http_api.py::test_http_post_sessions_runtime_value_error_returns_json_500 tests/mcp/test_http_api.py::test_http_post_sessions_runtime_type_error_returns_json_500 -q-> 8 passedPYTHONPATH=$PWD/src pytest tests/mcp/test_server.py tests/mcp/test_http_api.py tests/global_controller -q-> 203 passed, 1 skippedPYTHONPATH=$PWD/src pytest tests -q-> 493 passed, 11 skippedPYTHONPATH=$PWD/src mkdocs build-> passed with existing Material/nav warningspre-commit run --all-files-> passedgit diff --check origin/main...HEAD-> passedLocal review
Summary by CodeRabbit
New Features
Bug Fixes
503for startup-unavailable cases.Documentation
Tests