fix(mcp): make loopover-mcp CLI failures respect --json - #6113
Conversation
Wrap top-level runCli dispatch in try/catch and mirror @loopover/miner's
cli-error contract so --json failures emit { ok: false, error } on stdout
instead of a raw Node stack trace.
Closes JSONbored#5928
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6113 +/- ##
=======================================
Coverage 95.24% 95.24%
=======================================
Files 595 595
Lines 47046 47046
Branches 15015 15015
=======================================
Hits 44808 44808
Misses 1493 1493
Partials 745 745
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-15 10:12:49 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
packages/loopover-mcp/lib/cli-error.jsmirroring @loopover/miner's{ ok: false, error }contractrunClidispatch in try/catch so thrown errors never escape as raw Node stack tracesrunExpectingFailureand tests for unknown command, missing--login, and unsupported--agent-profilefailures with--jsonlib/cli-error.jsin MCP package dry-run checkCloses #5928
Supersedes #6104 (fork PR head stuck on prior SHA).
Test plan
npx vitest run test/unit/mcp-cli-basics.test.ts(21/21 pass)npx vitest run test/unit/mcp-cli-(all pass on Linux CI)