diff --git a/run_agent.py b/run_agent.py index 37572db5e1..18ac8210df 100644 --- a/run_agent.py +++ b/run_agent.py @@ -886,8 +886,8 @@ class AIAgent: "base_url": str(_routed_client.base_url), } # Preserve any default_headers the router set - if hasattr(_routed_client, '_default_headers') and _routed_client._default_headers: - client_kwargs["default_headers"] = dict(_routed_client._default_headers) + if hasattr(_routed_client, 'default_headers') and _routed_client.default_headers: + client_kwargs["default_headers"] = dict(_routed_client.default_headers) else: # When the user explicitly chose a non-OpenRouter provider # but no credentials were found, fail fast with a clear