Problem
When using Google Gemini as the primary model via provider: custom + base_url, everything works correctly (confirmed with v0.7.0). However, when trying to use the same Google Gemini endpoint as a fallback provider, resolve_provider_client in auxiliary_client.py fails with:
WARNING agent.auxiliary_client: resolve_provider_client: custom/main requested but no endpoint credentials found
WARNING root: Fallback to custom failed: provider not configured
This happens regardless of whether:
- fallback_model uses provider: custom with base_url + api_key_env
- fallback_model uses provider: custom with base_url + api_key: ${GOOGLE_API_KEY}
- fallback_model uses provider: google
- fallback_providers array entries include base_url/api_key fields
- custom_providers is used to register a named provider
- OPENAI_BASE_URL + OPENAI_API_KEY are set in .env
The root cause appears to be that resolve_provider_client does not resolve custom as a provider (returns None), and google is not in the supported fallback provider list. This is the same underlying issue as #4172, but that fix only addressed the primary model path — the fallback code path in auxiliary_client.py still has the same problem.
Expected Behavior
Google Gemini should work as a fallback provider, either:
- By adding google as a first-class fallback provider (using GOOGLE_API_KEY from .env), or
- By making provider: custom actually read base_url/api_key/api_key_env from fallback_model and fallback_providers config entries
Environment
Workaround
Using Gemini as the primary model instead and falling back to Codex/OpenRouter.
Problem
When using Google Gemini as the primary model via provider: custom + base_url, everything works correctly (confirmed with v0.7.0). However, when trying to use the same Google Gemini endpoint as a fallback provider, resolve_provider_client in auxiliary_client.py fails with:
WARNING agent.auxiliary_client: resolve_provider_client: custom/main requested but no endpoint credentials found
WARNING root: Fallback to custom failed: provider not configured
This happens regardless of whether:
The root cause appears to be that resolve_provider_client does not resolve custom as a provider (returns None), and google is not in the supported fallback provider list. This is the same underlying issue as #4172, but that fix only addressed the primary model path — the fallback code path in auxiliary_client.py still has the same problem.
Expected Behavior
Google Gemini should work as a fallback provider, either:
Environment
Workaround
Using Gemini as the primary model instead and falling back to Codex/OpenRouter.