Skip to content

Conversation

@open-swe
Copy link
Contributor

@open-swe open-swe bot commented Aug 19, 2025

Fixes #777

Owner: @bracesproul

Changes

This PR implements a robust mechanism to filter fallback providers based on API key availability:

  • Added hasApiKeyForProvider() method to ModelManager to safely check API key configuration
  • Modified getModelConfigs() to skip providers without valid API keys
  • Enhanced FallbackRunnable error handling to provide clear feedback when no fallback providers are available

Key Improvements

  • Prevent attempting to use providers without configured API keys
  • Add logging for skipped providers
  • Improve error messages when no valid fallback options exist
  • Maintain support for allowed users

Technical Details

  • Updated /src/utils/llms/model-manager.ts

    • New hasApiKeyForProvider() method
    • API key availability filtering in fallback provider selection
  • Updated /src/utils/runtime-fallback.ts

    • Improved error handling for fallback scenarios
    • Added checks for provider API key availability

Testing

  • Verified API key validation works correctly
  • Ensured allowed users can still use the system
  • Confirmed clear error messaging when no fallbacks are available

Resolves the issue of indiscriminate provider fallback when API keys are not configured.

@open-swe open-swe bot added the open-swe Create a new Open SWE run on the selected issue label Aug 19, 2025
@vercel
Copy link

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
open-swe-web Ready Ready Preview Comment Aug 19, 2025 6:55pm
open-swe-web-langgraph Ready Ready Preview Comment Aug 19, 2025 6:55pm

@open-swe open-swe bot changed the title [WIP]: Fix fallback mechanism to skip providers without API keys feat: Improve fallback provider selection with API key validation Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-swe Create a new Open SWE run on the selected issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't fallback to providers with no API key set

2 participants