Skip to content

[Phase 1] Graceful degradation: warn (never fake) when an MCP server is unavailable #678

Description

@github-actions

Story

As a maintainer of the pr-review engine,
I want detect an MCP server connection/init failure during a review and emit a GitHub warning annotation while the review still completes,
so that an unavailable MCP server degrades visibly (Fail Loud, Never Fake) instead of silently dropping context or emitting a fabricated "all clear" verdict.

Acceptance Criteria

  1. When the claude CLI reports an MCP server failed to connect/initialize, engine.sh emits a ::warning:: annotation naming the affected server and the review continues to completion using the model's base capabilities.
  2. An MCP failure never causes a fatal exit (no code-1 abort) and never short-circuits to an empty or fabricated "all clear" verdict.
  3. When MCP is not configured (knob unset), no MCP-related warnings are emitted.
  4. Behavior is covered by a test that simulates an unreachable server / failure marker in captured CLI output.

Tasks / Subtasks

Dev Notes

  • Builds directly on story 1's MCP plumbing in engine.sh.
  • Pattern to mirror: engine.sh already emits ::warning:: for throttled models (engine.sh:494) and the review pipeline already degrades-without-fatal-exit on oversized diffs (AGENTS.md 'Oversized PRs': the agent never exits 1 on a 406). Apply the same fail-loud-but-continue shape.
  • MCP connection/init errors surface in the CLI's stdout/stderr, captured in _claude_chain_invoke's final_stdout/final_stderr. When choosing a detection marker, AVOID tokens that collide with is_rate_limited()/_rate_limit_pattern — see the explicit caution at engine.sh:489-493 where fallback phrasing is kept clear of rate-limit tokens so downstream callers don't misclassify.
  • 'Graceful degradation (Fail Loud, Never Fake)' with disclosed warning annotations is a stated design requirement of MCP-Powered CI Review Enhancement — Standard #650; keep the warning human-readable in the Actions log/step summary.

Project Structure Notes

Confined to scripts/engine.sh and a bats test. No workflow changes.

References

  • scripts/engine.sh:494 (existing ::warning:: on model throttle)
  • scripts/engine.sh:489 (caution: avoid rate-limit token collisions)
  • AGENTS.md#oversized-prs-300-changed-files (never fatal-exit, degrade with note)
  • discussion MCP-Powered CI Review Enhancement — Standard #650 (Design item 3: graceful degradation)

Likely target surface

  • scripts/engine.sh
  • tests/

Story prepared by the BMAD Scrum Master (Bob) for epic #676. Status: ready-for-dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions