fix(providers): warn on shared API key for fallbacks and warm up all providers#130
Conversation
…providers - Warn when fallback providers share the same API key as primary (could fail if providers require different keys) - Warm up all providers instead of just the first, continuing on warmup failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @theonlyhennygod, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of provider management by introducing a warning mechanism for potentially misconfigured API keys in fallback scenarios and improving the provider warmup process. The changes ensure that all available providers are initialized, even if some encounter non-fatal issues during their setup, thereby increasing overall system resilience. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Caution Review failedThe pull request is closed. Warning
|
| Cohort / File(s) | Summary |
|---|---|
Provider Resilience Improvements src/providers/mod.rs, src/providers/reliable.rs |
Added runtime warning for API key reuse in non-Ollama fallbacks. Modified warmup to iterate all providers instead of just the first, treating per-provider failures as non-fatal warnings rather than propagating errors. |
Shell Tool Formatting src/tools/shell.rs |
Refactored tokio::time::timeout call from multi-line chained invocation to single-line expression with identical semantics. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- theonlyhennygod/zeroclaw#76: Directly related as this PR's warmup behavior changes (iterating all providers with non-fatal failures) modify the same ReliableProvider warmup functionality.
Poem
🐰 Warming up the warren with care,
No single burrow left to despair—
Each tunnel we test, each path we prepare,
With graceful stumbles we skip and share! 🌟
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
fix/provider-reliability-v2
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 @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Code Review
This pull request improves provider reliability by warming up all configured providers, not just the primary one, and makes warmup failures non-fatal. It also adds a warning to alert users when a fallback provider might be using an incorrect API key from the primary provider. The change to warm up all providers is well-implemented and increases resilience. However, the new warning for shared API keys incorrectly excludes the ollama provider. This could lead to silent misconfigurations where an API key for another service is wrongly used as a URL for Ollama. I've left a suggestion to address this.
| continue; | ||
| } | ||
|
|
||
| if api_key.is_some() && fallback != "ollama" { |
There was a problem hiding this comment.
The exception for ollama in this condition seems incorrect and could hide a potential misconfiguration. If the primary provider uses an API key (e.g., OpenAI's sk-...), that key will be passed to the OllamaProvider and misinterpreted as a base URL, causing connection failures. The warning should apply to ollama as well to alert the user of this likely incorrect configuration. A better long-term solution might be to handle API keys for different providers separately, but for now, removing this exception would make the warning more robust.
| if api_key.is_some() && fallback != "ollama" { | |
| if api_key.is_some() { |
…providers (zeroclaw-labs#130) - Warn when fallback providers share the same API key as primary (could fail if providers require different keys) - Warm up all providers instead of just the first, continuing on warmup failures Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Broker pushes lightweight notifications (message_id, from, kind) to agent gateways on new IPC messages. Agent receives push, invokes agent::run() to process inbox via agents_inbox tool. Polling remains as fallback. - PushDispatcher: background task with bounded mpsc(256), exponential backoff with ±25% jitter, configurable max retries - PushDedupSet: bounded LRU dedup (1000 entries) on agent side - Schema migration: delivery_status column (pending/pushed/failed) - Reconnect re-push: broker re-delivers pending messages on agent register-gateway (includes pushed status for crash recovery) - Config: push_enabled (default: true), push_max_retries (default: 5) - Security: proxy_token auth, no message body in payload, bounded queues, message_id validation, dedup prevents replay Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes