Skip to content

fix: add Gemini pre-flight check and engine-availability job summary#150

Merged
don-petry merged 1 commit into
mainfrom
claude/issue-146-20260512-1802
May 13, 2026
Merged

fix: add Gemini pre-flight check and engine-availability job summary#150
don-petry merged 1 commit into
mainfrom
claude/issue-146-20260512-1802

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Summary

  • New scripts/validate-engines.sh: provides validate_engines() which runs before any PR is processed. It checks Claude/Gemini/Copilot availability, exports CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits ::warning:: annotations that include the exact operator fix command (e.g. npm install -g @google/gemini-cli), and appends an engine-availability table to GITHUB_STEP_SUMMARY.
  • scripts/review-batch.sh: sources validate-engines.sh and calls validate_engines() at startup (before any PR loop). The Claude→Gemini fallback check uses the pre-computed $GEMINI_AVAILABLE flag. The "unavailable" warning in the fallback path is also updated to include the specific missing reason and install command.
  • New tests/test-validate-engines.sh: 8 unit tests covering degraded and healthy states for GEMINI_AVAILABLE, ::warning:: annotation content, and job-summary output.

Note: GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment explaining its role — no workflow-file changes required.

Acceptance criteria coverage

Criterion Status
Pre-flight check before any PR validate_engines() called at top of review-batch.sh
Warns with degraded state ::warning:: emitted with specific reason
Job summary shows engine availability ✅ Markdown table appended to GITHUB_STEP_SUMMARY
GOOGLE_API_KEY documented in workflow ✅ Already present at pr-review.yml:62
No silent skip — warning includes install command ✅ Both pre-flight and rate-limit warnings include npm install -g @google/gemini-cli
Existing behaviour when Gemini IS available unchanged ✅ Only adds a startup check; fallback chain logic preserved
Unit tests for validate_engines() ✅ 8 tests in tests/test-validate-engines.sh

Test plan

  • Run bash tests/test-validate-engines.sh locally — all 8 tests should pass
  • Trigger pr-review workflow with GOOGLE_API_KEY unset — confirm ::warning:: appears in job log with install command and job summary shows Gemini | unavailable
  • Trigger with GOOGLE_API_KEY set — confirm job summary shows Gemini | ok

Closes #146

Generated with Claude Code

Copilot AI review requested due to automatic review settings May 12, 2026 18:09
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 17 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c9a08a4-e3b3-442d-bc06-4d556658b40c

📥 Commits

Reviewing files that changed from the base of the PR and between 025b335 and 2defc12.

📒 Files selected for processing (3)
  • scripts/review-batch.sh
  • scripts/validate-engines.sh
  • tests/test-validate-engines.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-146-20260512-1802

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

CI is green and all checks pass. @petry-projects/org-leads — this PR is ready for review and merge when you have a chance. Closes #146

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an engine “pre-flight” validation step to the PR-review cascade so runs surface degraded fallback configuration (especially Gemini) up-front and in the GitHub Actions job summary, before any PRs are processed.

Changes:

  • Add scripts/validate-engines.sh to detect Claude/Gemini/Copilot availability, emit ::warning:: annotations, and append an availability table to GITHUB_STEP_SUMMARY.
  • Call validate_engines at the start of scripts/review-batch.sh and use the computed $GEMINI_AVAILABLE flag for Claude→Gemini fallback decisions.
  • Add unit tests in tests/test-validate-engines.sh to cover Gemini availability, warning text, and summary output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tests/test-validate-engines.sh Adds unit tests for validate_engines() behavior via PATH/env mocking.
scripts/validate-engines.sh Introduces pre-flight engine availability checks + job summary output.
scripts/review-batch.sh Runs pre-flight validation before processing PRs; reuses computed Gemini availability in fallback chain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +51
local extra_path="${1:-}"; shift
local combined_path="${extra_path:+$extra_path:}$MOCK_DIR:/usr/local/bin:/usr/bin:/bin"
(
Comment on lines +74 to +87
_emit_engine_summary() {
local claude_ok="$1" gemini_ok="$2" copilot_ok="$3"
local dest="${GITHUB_STEP_SUMMARY:-}"
[ -z "$dest" ] && return 0
{
printf '### Engine availability (pre-flight)\n\n'
printf '| Engine | Status |\n'
printf '|---------|--------|\n'
printf '| Claude | %s |\n' "$(_engine_badge "$claude_ok")"
printf '| Gemini | %s |\n' "$(_engine_badge "$gemini_ok")"
printf '| Copilot | %s |\n' "$(_engine_badge "$copilot_ok")"
printf '\n'
} >> "$dest"
}
Comment on lines +53 to +55
if env GH_TOKEN="${COPILOT_GITHUB_TOKEN:-${GH_TOKEN:-}}" \
gh copilot --version >/dev/null 2>&1; then
copilot_ok=true
Comment on lines +53 to +55
if env GH_TOKEN="${COPILOT_GITHUB_TOKEN:-${GH_TOKEN:-}}" \
gh copilot --version >/dev/null 2>&1; then
copilot_ok=true

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a pre-flight engine validation script and integrates it into the batch review process to ensure Claude, Gemini, and Copilot are correctly configured before execution. It also includes a new unit test suite for this validation logic. Feedback from the review suggests using more idiomatic shell variable expansion for string concatenation and adding a warning for Copilot unavailability to align with the script's documented behavior.

Comment on lines +32 to +42
local gemini_reasons=""
if ! command -v gemini >/dev/null 2>&1; then
gemini_reasons="Gemini CLI not installed (fix: npm install -g @google/gemini-cli)"
fi
if [ -z "${GOOGLE_API_KEY:-}" ]; then
if [ -n "$gemini_reasons" ]; then
gemini_reasons="$gemini_reasons; GOOGLE_API_KEY secret not set"
else
gemini_reasons="GOOGLE_API_KEY secret not set"
fi
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for building the gemini_reasons string can be simplified using the shell-idiomatic ${var:+$var; } pattern. This is more concise and matches the style used in scripts/review-batch.sh.

Suggested change
local gemini_reasons=""
if ! command -v gemini >/dev/null 2>&1; then
gemini_reasons="Gemini CLI not installed (fix: npm install -g @google/gemini-cli)"
fi
if [ -z "${GOOGLE_API_KEY:-}" ]; then
if [ -n "$gemini_reasons" ]; then
gemini_reasons="$gemini_reasons; GOOGLE_API_KEY secret not set"
else
gemini_reasons="GOOGLE_API_KEY secret not set"
fi
fi
local gemini_reasons=""
command -v gemini >/dev/null 2>&1 || gemini_reasons="Gemini CLI not installed (fix: npm install -g @google/gemini-cli)"
if [ -z "${GOOGLE_API_KEY:-}" ]; then
gemini_reasons="${gemini_reasons:+$gemini_reasons; }GOOGLE_API_KEY secret not set"
fi
References
  1. Use shell-idiomatic variable expansion for concise string concatenation. (link)

Comment on lines +53 to +56
if env GH_TOKEN="${COPILOT_GITHUB_TOKEN:-${GH_TOKEN:-}}" \
gh copilot --version >/dev/null 2>&1; then
copilot_ok=true
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PR description and file header mention that warnings are emitted for any unavailable fallback engine, but currently, only Gemini has a warning. Adding a warning for Copilot would ensure that configuration issues for all fallback engines are visible in the logs. This supports the engine fallback mechanism by ensuring fallbacks are correctly configured before rate limits are encountered.

Suggested change
if env GH_TOKEN="${COPILOT_GITHUB_TOKEN:-${GH_TOKEN:-}}" \
gh copilot --version >/dev/null 2>&1; then
copilot_ok=true
fi
if env GH_TOKEN="${COPILOT_GITHUB_TOKEN:-${GH_TOKEN:-}}" \
gh copilot --version >/dev/null 2>&1; then
copilot_ok=true
else
echo "::warning::Copilot fallback unavailable. When Gemini is rate-limited, runs will abort."
fi
References
  1. Ensure engine fallback mechanisms are supported by validating and reporting the status of fallback engines.

donpetry-bot
donpetry-bot previously approved these changes May 12, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: e8811fbfd49833b4eb8e68f395cf69cbb8c80727
Cascade: triage → deep (triage: haiku 4.5 → deep: sonnet 4.6 + duck: o4-mini → audit: opus 4.7)

Summary

PR satisfies all issue #146 acceptance criteria: pre-flight Gemini check, actionable warnings, job summary table, and unit tests — all CI passes. The headline concern from triage is a real but minor defect: the validate-engines.sh header comment claims '::warning:: annotations emitted for each unavailable engine' but only Gemini gets one; Claude and Copilot availability failures export env vars silently. This is a documentation/completeness gap, not a security or logic regression. No HIGH-risk patterns found.

Findings

  • MINOR: Header comment at lines 12-14 of validate-engines.sh states 'For each unavailable fallback engine a ::warning:: annotation is emitted' but only Gemini emits a ::warning::. Claude unavailability and Copilot unavailability are captured in exported vars (CLAUDE_AVAILABLE, COPILOT_AVAILABLE) but produce no annotation. The docstring overpromises, and gemini-code-assist flagged this exact gap without it being addressed before the PR was submitted. (scripts/validate-engines.sh line 13)
  • MINOR: All 8 unit tests cover only Gemini scenarios. There are no tests for CLAUDE_AVAILABLE or COPILOT_AVAILABLE flag values, nor for warnings (or their absence) on those engines. This leaves the documented-but-unimplemented behaviour path untested and makes it harder to detect future regressions. (tests/test-validate-engines.sh )
  • INFO: The else-branch in review-batch.sh (lines ~77-80) re-derives _gemini_miss by re-running 'command -v gemini' and checking GOOGLE_API_KEY at the rate-limit fallback point. Since validate_engines() already ran at startup, the same information is in GEMINI_AVAILABLE and the reasons were already logged. The duplication is harmless but means availability logic exists in two places. (scripts/review-batch.sh line 77)
  • INFO: _engine_badge() and _emit_engine_summary() are defined at file scope in validate-engines.sh. Sourcing the script exports these helper functions into the caller's namespace. Underscore prefix signals 'private' by convention but bash does not enforce it. Not a security risk; worth noting for future maintainability. (scripts/validate-engines.sh line 63)

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: o4-mini → audit: opus 4.7). Reply if you need a human review.

@donpetry-bot
donpetry-bot enabled auto-merge (squash) May 12, 2026 20:51
@github-actions

Copy link
Copy Markdown
Contributor

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved manually.

Please resolve the conflicts and push:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 2defc129236a3a75479959d55ba87c34e4562cc4
Review mode: triage-approved (single reviewer)

Summary

Confirmation pass on triage's low-risk clearance. The PR adds a pre-flight engine-availability check (scripts/validate-engines.sh), wires it into scripts/review-batch.sh so the Claude→Gemini fallback uses a pre-computed $GEMINI_AVAILABLE flag, and adds 8 unit tests for the new helper. The change is well-scoped, tested, and the headline acceptance-criteria gap from the previous cycle (silent Gemini skip with no operator signal) is closed end-to-end. No HIGH-risk patterns: no auth/secrets/crypto changes, no DB migrations, no shell-injection sinks, no GitHub Actions security smells.

Linked issue analysis

Closes #146. All five acceptance criteria are met:

  1. Pre-flight checkvalidate_engines() is invoked at the top of review-batch.sh before any PR is processed.
  2. Job summary — A Markdown engine-availability table is appended to GITHUB_STEP_SUMMARY (_emit_engine_summary).
  3. Secret documentedGOOGLE_API_KEY is already forwarded in pr-review.yml:62 per the PR description; no workflow-file change required.
  4. No silent skip — Both the startup warning and the rate-limit fallback warning include the exact install command npm install -g @google/gemini-cli and the specific missing reason.
  5. Existing healthy-path behaviour unchanged — When Gemini is available, the fallback chain flows identically to before; only the gate now reads $GEMINI_AVAILABLE instead of re-deriving it.

Findings

None blocking. The minor documentation/completeness items flagged in the prior cycle (docstring overpromises warnings for all three engines but only Gemini emits one; tests cover only Gemini scenarios) are non-blocking polish items and do not affect correctness. They can be addressed in a follow-up without holding this fix.

CI status

All required checks green:

  • agent-shield / AgentShield — SUCCESS
  • claude-code / claude — SUCCESS
  • CodeQL / Analyze (actions) — SUCCESS
  • dependency-audit / Detect ecosystems — SUCCESS
  • SonarCloud / SonarCloud Code Analysis — SUCCESS (Quality Gate Passed, 0 new issues)
  • Tests / unit-tests — SUCCESS
  • CodeRabbit — SUCCESS
  • Dependabot config check — SUCCESS

Skipped checks (claude-ci-fix, claude-issue, language-specific audit branches, dependabot-automerge) are expected for a non-dependabot, non-issue, shell-only PR.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.

@don-petry
don-petry merged commit 940f0c6 into main May 13, 2026
18 checks passed
@don-petry
don-petry deleted the claude/issue-146-20260512-1802 branch May 13, 2026 17:01
don-petry added a commit that referenced this pull request Jun 7, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 7, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 8, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 12, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 18, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
Addresses #146 — silent Gemini fallback failures when GOOGLE_API_KEY is
missing or the CLI is not installed.

Changes:
- scripts/validate-engines.sh (new): provides validate_engines() which
  checks Claude/Gemini/Copilot availability at startup, exports
  CLAUDE_AVAILABLE / GEMINI_AVAILABLE / COPILOT_AVAILABLE, emits
  ::warning:: annotations that include the exact fix command (e.g.
  'npm install -g @google/gemini-cli'), and writes an engine-availability
  table to GITHUB_STEP_SUMMARY.
- scripts/review-batch.sh: sources validate-engines.sh and calls
  validate_engines() before any PR is processed; the Claude→Gemini
  fallback check now uses the pre-computed $GEMINI_AVAILABLE flag;
  the "unavailable" warning also includes the specific missing reason
  and install command.
- tests/test-validate-engines.sh (new): 8 unit tests covering the
  degraded and healthy states for GEMINI_AVAILABLE, ::warning::
  annotation content, and job-summary output.

GOOGLE_API_KEY is already forwarded in pr-review.yml:62 with a comment;
no workflow-file changes are needed.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Don Petry <don-petry@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants