fix(provider): preserve fallback runtime options when resolving credentials
This commit is contained in:
parent
bb22bdc8fb
commit
435c33d408
1 changed files with 5 additions and 6 deletions
|
|
@ -822,15 +822,14 @@ pub fn create_resilient_provider_with_options(
|
||||||
|
|
||||||
// Each fallback provider resolves its own credential via provider-
|
// Each fallback provider resolves its own credential via provider-
|
||||||
// specific env vars (e.g. DEEPSEEK_API_KEY for "deepseek") instead
|
// specific env vars (e.g. DEEPSEEK_API_KEY for "deepseek") instead
|
||||||
// of inheriting the primary provider's key. Passing `None` lets
|
// of inheriting the primary provider's key. Passing `None` lets
|
||||||
// `resolve_provider_credential` check the correct env var for the
|
// `resolve_provider_credential` check the correct env var for the
|
||||||
// fallback provider name.
|
// fallback provider name.
|
||||||
//
|
//
|
||||||
// Route through `create_provider_with_url` (not
|
// Keep using `create_provider_with_options` so fallback entries that
|
||||||
// `create_provider_with_options`) so that `custom:` URL prefixes
|
// require runtime options (for example Codex auth profile overrides)
|
||||||
// (e.g. "custom:http://host.docker.internal:1234/v1") work as
|
// continue to work.
|
||||||
// fallback entries.
|
match create_provider_with_options(fallback, None, options) {
|
||||||
match create_provider_with_url(fallback, None, None) {
|
|
||||||
Ok(provider) => providers.push((fallback.clone(), provider)),
|
Ok(provider) => providers.push((fallback.clone(), provider)),
|
||||||
Err(_error) => {
|
Err(_error) => {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue