Repository navigation
fix(mcp): gaia mcp engineering and code-index print their refusal, not a traceback - #7536
Conversation
|
Verdict: Approve When Real-world evidenceN/A here: no evidence bundle was produced for this run. The PR description has before and after output from the real CLI for both commands (traceback before; one line and exit 1 after), and that matches the code. The working paths of both servers are unchanged and already covered by the existing stdio tests. 🔍 Technical detailsIssues found: none blocking.
Checked
Strengths
|
1fe35f3 to
9ef75c4
Compare
…t a traceback Both servers refuse to start for a stated reason (no --developer-mode; the home directory as the repo) and let the exception escape. Print the reason on stderr and exit 1, which is what an MCP client shows the user. Closes amd#7335
9ef75c4 to
c44ff4f
Compare
… valid with no traceback bugs left
Summary
gaia mcp engineeringwithout--developer-modeandgaia mcp code-indexfrom the home directory refuse to start for a stated reason. They now print that reason on stderr and exit 1, with no traceback.Why
Both servers let the exception escape (
PermissionError,ValueError). An MCP client that launches them shows the user whatever the server printed, so a refusal that's meant to be read arrived as a Python crash.Linked issue
Closes #7335
Changes
mcp/servers/engineering_mcp.pymain(): catches thePermissionErrorfrom building the server and exits withgaia mcp engineering: <reason>. That covers the missing developer-mode flag and a rejected credential.mcp/servers/code_index_mcp.pymain(): asks_refuse_home_directorydirectly and exits withgaia mcp code-index: <reason>. The service still refuses on its own, so library callers are unchanged, and no otherValueErroris caught.main(), sogaia mcp …andpython -m gaia.mcp.servers.…behave the same.create_engineering_mcpandCodeIndexServicestill raise, so their existing tests are untouched.Test plan
pytest tests/mcp/test_engineering_mcp.py tests/mcp/test_code_index_mcp.py tests/unit/test_code_index_mcp_service.py: 36 passed, 1 skipped (includes the existing launch-failure test, which still sees "home directory" in stderr)gaia mcp …as a subprocess and assert exit 1, the reason on stderr and noTraceback. Both fail onmain.python util/lint.py --black --isort: passmcpextra (mcp>=2.0.0,<3.0) has to be installed for these test files to collect.Evidence
The real CLI (
gaia.cli.main), an empty profile,code-indexrun from the home directory:Checklist
Closes #N/Fixes #N/Refs #N).