mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 01:31:41 +00:00
fix(run_agent): use public default_headers attr when preserving routed client headers
The OpenAI Python SDK stores default headers on the public attribute, not the private . Because the code checked for the private attribute, provider-specific headers (e.g. Kimi's User-Agent) were silently dropped, causing 403 errors for Kimi Coding API users. Fixes #8779
This commit is contained in:
parent
83ca0844f7
commit
0c376841dc
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue