Skip to content

fix: forward base_url and api_key from fallback config to resolve_provider_client#4784

Open
tomwhipple wants to merge 1 commit intoNousResearch:mainfrom
tomwhipple:fix/fallback-model-base-url-not-forwarded
Open

fix: forward base_url and api_key from fallback config to resolve_provider_client#4784
tomwhipple wants to merge 1 commit intoNousResearch:mainfrom
tomwhipple:fix/fallback-model-base-url-not-forwarded

Conversation

@tomwhipple
Copy link
Copy Markdown

@tomwhipple tomwhipple commented Apr 3, 2026

Summary

  • _try_activate_fallback was calling resolve_provider_client without forwarding base_url or api_key from the fallback config
  • For provider: custom with an explicit base_url, this caused the router to fall through to the primary provider's credentials — routing the fallback model slug to the wrong endpoint and returning a 404
  • Fix: pass explicit_base_url=fb.get("base_url") and explicit_api_key=fb.get("api_key") in the call

🤖 Generated with Claude Code

…vider_client

When a custom fallback model is configured with an explicit base_url (e.g. a
local Ollama endpoint), _try_activate_fallback was not passing it as
explicit_base_url to resolve_provider_client. The custom provider then fell
through to the primary provider's credentials, routing the fallback model slug
to the wrong API endpoint and returning a 404.

Adds explicit_base_url and explicit_api_key forwarding, and strengthens the
existing test plus adds a regression test that asserts the kwargs are passed.

Co-Authored-By: Claude Sonnet 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