mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
fix(delegate): sync self.base_url with client_kwargs after credential resolution
When delegation.base_url routes subagents to a different endpoint, the correct URL was passed through _resolve_delegation_credentials() and _build_child_agent() into AIAgent.__init__(), but self.base_url could fall out of sync with client_kwargs["base_url"] — the value the OpenAI client actually uses. This caused billing_base_url in session records to show the parent's endpoint while actual API calls went to the correct delegation target. Keep self.base_url in sync with client_kwargs after the credential resolution block, matching the existing pattern for self.api_key. Fixes #6825
This commit is contained in:
parent
4fb42d0193
commit
6c115440fd
1 changed files with 1 additions and 0 deletions
|
|
@ -947,6 +947,7 @@ class AIAgent:
|
|||
client_kwargs["default_headers"] = headers
|
||||
|
||||
self.api_key = client_kwargs.get("api_key", "")
|
||||
self.base_url = client_kwargs.get("base_url", self.base_url)
|
||||
try:
|
||||
self.client = self._create_openai_client(client_kwargs, reason="agent_init", shared=True)
|
||||
if not self.quiet_mode:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue