fix(tools/delegate): propagate resolved ACP runtime settings to child agents

This commit is contained in:
Junass1 2026-04-20 22:19:36 +03:00 committed by Teknium
parent fc8e4ebf8e
commit 735996d2ad
2 changed files with 44 additions and 2 deletions

View file

@ -768,6 +768,7 @@ def delegate_task(
children = []
try:
for i, t in enumerate(task_list):
task_acp_args = t.get("acp_args") if "acp_args" in t else None
child = _build_child_agent(
task_index=i, goal=t["goal"], context=t.get("context"),
toolsets=t.get("toolsets") or toolsets, model=creds["model"],
@ -775,8 +776,10 @@ def delegate_task(
override_provider=creds["provider"], override_base_url=creds["base_url"],
override_api_key=creds["api_key"],
override_api_mode=creds["api_mode"],
override_acp_command=t.get("acp_command") or acp_command,
override_acp_args=t.get("acp_args") or acp_args,
override_acp_command=t.get("acp_command") or acp_command or creds.get("command"),
override_acp_args=task_acp_args if task_acp_args is not None else (
acp_args if acp_args is not None else creds.get("args")
),
)
# Override with correct parent tool names (before child construction mutated global)
child._delegate_saved_tool_names = _parent_tool_names