feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable - #717
Conversation
…ver fake) when an MCP server is unavailable
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 40 minutes and 42 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
There was a problem hiding this comment.
Code Review
This pull request implements graceful degradation for MCP server connection and initialization failures by scanning CLI output files and emitting a warning without altering the final exit code. It also adds comprehensive unit tests to verify this behavior. A critical issue was identified in the server name extraction pipeline, where a grep failure could trigger 'set -e' and prematurely terminate the script; appending '|| true' to the pipeline is recommended to prevent this.
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: 3f752165d8f38c986caa8e3f356e58c8e0d13140
Review mode: triage-approved (single reviewer)
Summary
Adds warn-and-continue graceful degradation for MCP server connection/init failures in scripts/engine.sh (issue #678), plus 5 bats tests. The new _emit_mcp_failure_warning helper scans captured CLI output and emits a ::warning:: naming the affected server(s) without ever altering final_rc — so the review completes on the model's base capabilities rather than fatal-exiting or faking an all-clear. +117/-0 across 2 files; logic is isolated and control-flow-neutral.
Linked issue analysis
Closes #678. All four acceptance criteria are substantively met: AC#1 (::warning:: names the failed server and review continues), AC#2 (no fatal exit, no fabricated/empty verdict — final_rc untouched), AC#3 (inert when REVIEW_MCP_CONFIG knob is unset), AC#4 (synthetic failure transcripts asserted in tests). Implementation stays confined to engine.sh + a bats file as the issue specified, and the failure regex is deliberately kept clear of rate-limit vocabulary to avoid misclassification into cross-engine fallback, per the issue's dev notes.
Findings
No blocking findings. Prior gemini-code-assist review on the first commit (1ba4da2) flagged a set -e risk: a grep pipeline failure could prematurely terminate the script. Verified resolved in the fix commit (3f75216), which appended '|| true' to the server-name extraction pipeline; the detection grep is also guarded with '|| return 0'. coderabbit review was dismissed (rate-limited). No unresolved human review threads or unanswered questions. Warn-only feature with no control-flow impact and good test coverage (agentic + duck paths, knob-set/unset, named/unnamed server).
CI status
All required checks green. shellcheck, bats, unit-tests, CodeQL (actions + python), SonarCloud (Quality Gate passed), gitleaks secret scan, AgentShield, and dev-lead test suite all SUCCESS; dependency-audit ecosystem sub-jobs and dependabot SKIPPED as expected. mergeStateStatus is BLOCKED only because org-leads review is still required (REVIEW_REQUIRED), not due to any failing check.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ver fake) when an MCP server is unavailable (#717) * feat: implement issue #678 — [Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>



Closes #678
Implemented by dev-lead agent. Please review.