Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4520,8 +4520,20 @@ def _try_activate_fallback(self) -> bool:
# access for Codex providers.
try:
from agent.auxiliary_client import resolve_provider_client
fb_base_url_explicit = (fb.get("base_url") or "").strip() or None
fb_api_key_explicit = (fb.get("api_key") or "").strip()
if not fb_api_key_explicit:
fb_key_env = (fb.get("api_key_env") or "").strip()
if fb_key_env:
fb_api_key_explicit = os.getenv(fb_key_env, "").strip()
fb_api_key_explicit = fb_api_key_explicit or None
fb_client, _ = resolve_provider_client(
fb_provider, model=fb_model, raw_codex=True)
fb_provider,
model=fb_model,
raw_codex=True,
explicit_base_url=fb_base_url_explicit,
explicit_api_key=fb_api_key_explicit,
)
if fb_client is None:
logging.warning(
"Fallback to %s failed: provider not configured",
Expand Down