Skip to content

fix: Gemini fallback unavailable when Claude is rate-limited (no CLI / no GOOGLE_API_KEY) #146

Description

@don-petry

Parent issue

#145

Problem

When Claude hits a rate limit during a review run, the workflow is designed to fall back to the Gemini engine. In run #715 this fallback silently failed:

##[warning]Claude rate limit hit but Gemini fallback unavailable
(CLI not installed or GOOGLE_API_KEY missing) — falling through to Copilot

The warning is emitted and the session continues to the Copilot engine, but:

  • There is no validation step at workflow startup confirming Gemini is reachable.
  • The GOOGLE_API_KEY secret is not set (or not forwarded) in the runner environment, so every Claude exhaustion event silently skips Gemini and goes straight to Copilot — which may also be rate-limited (as happened here).
  • Operators have no early signal that the Gemini buffer is non-functional.

Acceptance criteria

  1. Pre-flight check: at workflow startup (before processing any PR), the script validates that the Gemini fallback is configured (CLI present + GOOGLE_API_KEY non-empty). If not, emit a ##[warning] and continue, but record the degraded state.
  2. Job summary: the run summary clearly states whether each engine (Claude / Gemini / Copilot) was available at startup.
  3. Secret documented: GOOGLE_API_KEY is added to the workflow's env block (or secrets) with a comment explaining its role. Repo/org secret must be configured.
  4. No silent skip: if Gemini CLI is missing, the warning must include the exact install command so operators can fix it without reading docs.
  5. Existing behaviour when Gemini IS available is unchanged.

Expected tests

  • Unit (bash/bats or shellcheck): validate_engines() helper returns correct degraded-state flag when GOOGLE_API_KEY is unset.
  • Unit: validate_engines() returns healthy when CLI is present and key is set.
  • Integration (dry-run): workflow invoked with GOOGLE_API_KEY unset emits the expected ##[warning] line in job output.
  • Integration (dry-run): job summary lists gemini: unavailable when key is absent and gemini: ok when present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reports

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions