Skip to content

fix(providers): warn on shared API key for fallbacks and warm up all providers#130

Merged
theonlyhennygod merged 1 commit intomainfrom
fix/provider-reliability-v2
Feb 15, 2026
Merged

fix(providers): warn on shared API key for fallbacks and warm up all providers#130
theonlyhennygod merged 1 commit intomainfrom
fix/provider-reliability-v2

Conversation

@theonlyhennygod
Copy link
Copy Markdown
Collaborator

@theonlyhennygod theonlyhennygod commented Feb 15, 2026

  • 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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added runtime warning notifications when using provider fallbacks with API keys, alerting users about potential key reuse behavior between primary and fallback providers.
  • Bug Fixes

    • Enhanced provider warmup process to attempt initialization of all configured providers instead of stopping after the first failure, improving overall system resilience.

…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>
@theonlyhennygod theonlyhennygod merged commit 1e19b12 into main Feb 15, 2026
6 of 9 checks passed
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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

  • API Key Warning: A warning is now issued when fallback providers are configured to use the same API key as the primary provider, as this could lead to failures if different keys are required.
  • Provider Warmup: The system now attempts to warm up all configured providers instead of just the first one, and it will continue the warmup process even if individual provider warmups fail.

🧠 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
  • src/providers/mod.rs
    • Added a warning log when a fallback provider is detected to be using the primary provider's API key, excluding 'ollama'.
  • src/providers/reliable.rs
    • Modified the warmup method to iterate over and warm up all providers in the list.
    • Changed the warmup logic to log errors as warnings and continue processing other providers, rather than failing immediately.
  • src/tools/shell.rs
    • Refactored the tokio::time::timeout call for improved code formatting and readability.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 15, 2026

Caution

Review failed

The pull request is closed.

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Expected boolean, received object at "reviews.poem"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Modified provider fallback handling to emit a runtime warning when non-Ollama fallbacks reuse primary API keys. Enhanced warmup logic to iterate over all providers with non-fatal per-provider error handling. Applied minor formatting refactor to shell tool timeout handling.

Changes

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.

❤️ Share

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

Copy link
Copy Markdown

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

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 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.

Comment thread src/providers/mod.rs
continue;
}

if api_key.is_some() && fallback != "ollama" {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

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.

Suggested change
if api_key.is_some() && fallback != "ollama" {
if api_key.is_some() {

AllenHyang pushed a commit to AllenHyang/zeroclaw that referenced this pull request Feb 20, 2026
…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>
@theonlyhennygod theonlyhennygod deleted the fix/provider-reliability-v2 branch March 12, 2026 00:06
panviktor referenced this pull request in panviktor/synapseclaw Mar 19, 2026
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>
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.

1 participant