Repository navigation
feat: implement issue #1777 — Gemini is not working optimally - #1780
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedNext included review available in 38 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (9)
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 |
There was a problem hiding this comment.
Code Review
This pull request updates the default Gemini flash model to gemini-3.8-flash and adjusts the fallback engine order to claude → gemini → copilot. It also introduces per-key rotation for Gemini API keys (GEMINI_API_KEY, GOOGLE_API_KEY, GOOGLE_API_KEY_2, and GOOGLE_API_KEY_3) to handle rate limits gracefully before downgrading models or providers, along with corresponding unit tests. The review feedback suggests utilizing $BATS_TEST_TMPDIR in the new and updated BATS tests instead of manually managing temporary files and directories with mktemp and rm to ensure proper test isolation and automatic cleanup.
Dev-Lead — review-changes (applied)Changes committed and pushed. |
|
CI checks on this PR are still running. Once they complete, re-mention Posted by the donpetry-bot PR-review cascade. |
Dev-Lead — fix-bot-comment (applied)Changes committed and pushed. |
Dev-Lead — fix-bot-comment (applied)Changes committed and pushed. |
|
CI checks on this PR are still running. Once they complete, re-mention Posted by the donpetry-bot PR-review cascade. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-13T05:15:55Z. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: db788cd35ef95fdc8337e136e484b520d91e92bb
Cascade: triage → audit (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5)
Summary
Gemini multi-key rotation PR expands the credential surface (GOOGLE_API_KEY_2/_3) but handles it safely: optional secrets wired identically to the existing GOOGLE_API_KEY pattern into first-party scripts, no key value ever logged (warnings name variables only, billing probe uses a header not the URL), and rotation saves/restores caller key env correctly. All three unresolved CodeAnt majors that drove escalation are verified fixed at head SHA (validate-engines.sh accepts all four keys, engine.sh config-gap uses _gemini_api_keys with a secondary-only bats test, review-batch.sh matches the claude->gemini->copilot order). Remaining items are minor robustness/process nits, not security issues; human review is still required by branch protection.
Downstream impact
This change is consumed by 8 downstream repo(s) that pin the affected reusable workflow / lib / prompt. Impacted consumers:
Impacted shared surfaces:
- .github/workflows/dev-lead-reusable.yml
- .github/workflows/pr-review.yml
Impacted consumers (8, fetching up to 10):
- petry-projects/.github (pins .github/workflows/dev-lead-reusable.yml)
.github/workflows/dev-lead.yml
- petry-projects/.github-private (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
.github/workflows/dev-lead.yml
.github/workflows/pr-review-canary.yml
.github/workflows/pr-review-trigger.yml
.github/workflows/test-dev-lead.yml
- petry-projects/ContentTwin (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
.github/workflows/dev-lead.yml
.github/workflows/pr-review.yml
- petry-projects/TalkTerm (pins .github/workflows/dev-lead-reusable.yml)
.github/workflows/dev-lead.yml
- petry-projects/bmad-bgreat-suite (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
.github/workflows/dev-lead.yml
.github/workflows/pr-review.yml
- petry-projects/broodly (pins .github/workflows/dev-lead-reusable.yml)
.github/workflows/dev-lead.yml
- petry-projects/google-app-scripts (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
.github/workflows/dev-lead.yml
.github/workflows/pr-review.yml
- petry-projects/markets (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
.github/workflows/dev-lead.yml
.github/workflows/pr-review.yml
Findings
- info: New optional secrets GOOGLE_API_KEY_2/_3 forwarded into run-step env across dev-lead jobs. Verified benign: first-party pinned reusables, required:false (no downstream startup failures for the 8 pinned consumers), no echo of key values anywhere in the diff, rotation loop restores original GOOGLE_API_KEY/GEMINI_API_KEY with correct set/unset semantics, and STUB_ENGINE_RECORD_KEYS key-recording exists only in the test fixture with dummy keys.
- minor: _gemini_billing_probe only probes the FIRST configured key. If the primary key's prepayment credits are depleted while GOOGLE_API_KEY_2/_3 still have credit, validate_engines marks Gemini unavailable and per-key rotation never gets a chance - partially undercutting the resilience goal of #1777. Suggest probing keys in _gemini_api_keys order until one is not billing-depleted. Availability gap, not a security issue.
- minor: Nested default expansion
${GOOGLE_API_KEY_2:-${GOOGLE_API_KEY_3}}omits:-on the innermost variable; under set -u this is an unbound-variable crash if the first three keys are empty/unset and GOOGLE_API_KEY_3 is unset. Currently unreachable (the probe is only called after validate_engines confirms at least one non-empty key, and workflows always define the env vars), but a latent trap for future callers. Use${GOOGLE_API_KEY_3:-}. - minor: review-batch.sh dropped the classic-PAT guard (
COPILOT_GITHUB_TOKEN != ghp_*) when Copilot moved to last fallback; the copilot leg now gates only on COPILOT_AVAILABLE, which is derived fromgh copilot --versionand may pass with a classic PAT that then fails at Copilot API call time. engine.sh's own fallback path retains its guard. Failure mode is a skipped review with a warning, not a security exposure. - info: PR description lacks explicit risk/test-plan/rollback sections (DESCRIPTION_MISSING=3). Mitigating: rollback is a clean revert (new secrets are optional and additive), and the change ships a dedicated 193-line bats suite covering rotation, de-dup, config-gap recognition, and fallback ordering.
Reviewed by the PR-review cascade (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5). Reply if you need a human review.
|



User description
Closes #1777
Implemented by dev-lead agent. Please review.
CodeAnt-AI Description
Improve Gemini availability with multi-key rotation and an updated model
What Changed
gemini-3.8-flashfor triage and action work by default.Impact
✅ Fewer Gemini quota-related failures✅ Fewer unnecessary model or provider fallbacks✅ Faster recovery when a Gemini key is rate-limited💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.