Skip to content

Commit d64d345

Browse files
committed
dag test
1 parent 5304c82 commit d64d345

7 files changed

Lines changed: 1132 additions & 13 deletions

File tree

astrbot/core/astr_agent_tool_exec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ async def _execute_handoff(
385385
subagent_trace.record(
386386
"subagent_execution_begin",
387387
agent_name=agent_name,
388-
input_preview=input_[:500] if input_ else None,
388+
input=input_ if input_ else None,
389389
image_count=len(image_urls),
390390
tools=[t.name for t in toolset] if toolset else [],
391391
max_steps=agent_max_step,
@@ -414,7 +414,7 @@ async def _execute_handoff(
414414
"subagent_system_prompt",
415415
agent_name=agent_name,
416416
prompt_length=len(subagent_system_prompt),
417-
prompt_preview=subagent_system_prompt[:300]
417+
prompt=subagent_system_prompt
418418
if subagent_system_prompt
419419
else None,
420420
)
@@ -480,7 +480,7 @@ async def _run_subagent():
480480
subagent_trace.record(
481481
"subagent_execution_complete",
482482
agent_name=agent_name,
483-
result_preview=llm_resp.completion_text[:500]
483+
result=llm_resp.completion_text
484484
if hasattr(llm_resp, "completion_text") and llm_resp.completion_text
485485
else None,
486486
result_length=len(llm_resp.completion_text)
@@ -883,7 +883,7 @@ async def _execute_local(
883883
while True:
884884
try:
885885
if (
886-
tool.name == "wait_for_subagent"
886+
tool.name == "wait_for_subagent" or tool.name == "orchestrate_tasks"
887887
): # wait工具有自己的超时,避免受到tool_call_timeout影响
888888
resp = await asyncio.wait_for(
889889
anext(wrapper),

astrbot/core/astr_main_agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ async def _apply_subagent_manager_tools(
10351035
CREATE_SUBAGENT_TOOL,
10361036
LIST_SUBAGENTS_TOOL,
10371037
MANAGE_SUBAGENT_PROTECTION_TOOL,
1038+
ORCHESTRATE_TASKS_TOOL,
10381039
REMOVE_SUBAGENT_TOOL,
10391040
VIEW_SHARED_CONTEXT_TOOL,
10401041
WAIT_FOR_SUBAGENT_TOOL,
@@ -1073,6 +1074,10 @@ async def _apply_subagent_manager_tools(
10731074
# Register dynamic subagent management tools (only when dynamic creation is enabled)
10741075
# Always register `wait_for_subagent` for better background task running
10751076
req.func_tool.add_tool(WAIT_FOR_SUBAGENT_TOOL)
1077+
# Register DAG orchestration tool if enabled
1078+
dag_cfg = orch_cfg.get("dag_enabled", True)
1079+
if dag_cfg:
1080+
req.func_tool.add_tool(ORCHESTRATE_TASKS_TOOL)
10761081
if enable_dynamic:
10771082
req.func_tool.add_tool(CREATE_SUBAGENT_TOOL)
10781083
req.func_tool.add_tool(REMOVE_SUBAGENT_TOOL)

astrbot/core/config/default.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
"remove_subagent",
223223
"list_subagents",
224224
"wait_for_subagent",
225+
"orchestrate_tasks",
225226
"broadcast_shared_context",
226227
"view_shared_context",
227228
],
@@ -233,6 +234,10 @@
233234
"shared_context_maxlen": 300,
234235
"subagent_history_maxlen": 300,
235236
"execution_timeout": 1200,
237+
"dag_enabled": True,
238+
"dag_max_nodes": 10,
239+
"dag_max_parallel": 5,
240+
"dag_max_inject_length": 4000,
236241
},
237242
"provider_stt_settings": {
238243
"enable": False,

0 commit comments

Comments
 (0)