fix(provider): preserve fallback runtime options when resolving credentials

This commit is contained in:
Chummy 2026-02-19 18:37:37 +08:00
parent bb22bdc8fb
commit 435c33d408

View file

@ -826,11 +826,10 @@ pub fn create_resilient_provider_with_options(
// `resolve_provider_credential` check the correct env var for the
// fallback provider name.
//
// Route through `create_provider_with_url` (not
// `create_provider_with_options`) so that `custom:` URL prefixes
// (e.g. "custom:http://host.docker.internal:1234/v1") work as
// fallback entries.
match create_provider_with_url(fallback, None, None) {
// Keep using `create_provider_with_options` so fallback entries that
// require runtime options (for example Codex auth profile overrides)
// continue to work.
match create_provider_with_options(fallback, None, options) {
Ok(provider) => providers.push((fallback.clone(), provider)),
Err(_error) => {
tracing::warn!(