mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(tools): enforce ACP transport overrides in delegate_task child agents
When override_acp_command was passed to _build_child_agent, it failed to override effective_provider to 'copilot-acp' and effective_api_mode to 'chat_completions'. This caused the child AIAgent to inherit the parent's native API configuration (e.g. Anthropic) and attempt real HTTP requests using the parent's API key, leading to HTTP 401 errors and completely bypassing the ACP subprocess. Ensure that if an ACP command override is provided, the child agent correctly routes through CopilotACPClient. Refs #2653
This commit is contained in:
parent
33773ed5c6
commit
5d09474348
1 changed files with 6 additions and 0 deletions
|
|
@ -922,6 +922,12 @@ def _build_child_agent(
|
|||
else (getattr(parent_agent, "acp_args", []) or [])
|
||||
)
|
||||
|
||||
if override_acp_command:
|
||||
# If explicitly forcing an ACP transport override, the provider MUST be copilot-acp
|
||||
# so run_agent.py initializes the CopilotACPClient.
|
||||
effective_provider = "copilot-acp"
|
||||
effective_api_mode = "chat_completions"
|
||||
|
||||
# Resolve reasoning config: delegation override > parent inherit
|
||||
parent_reasoning = getattr(parent_agent, "reasoning_config", None)
|
||||
child_reasoning = parent_reasoning
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue