sync update from LAN repo (source dhk-1 @ 3b1ec5b4)
This commit is contained in:
1 parent
da6521b6cb
commit
264e2200d6
995 files changed
+148105
-13399
No files matched your search
+8
-2
@@ -147,7 +147,7 @@ async def task_tool(
|
||||
|
||||
# Get available tools (excluding task tool to prevent nesting)
|
||||
# Lazy import to avoid circular dependency
|
||||
from deerflow.tools import get_available_tools
|
||||
from deerflow.tools import get_available_tools_async
|
||||
|
||||
# Inherit parent agent's tool_groups so subagents respect the same restrictions
|
||||
parent_tool_groups = metadata.get("tool_groups")
|
||||
@@ -157,6 +157,8 @@ async def task_tool(
|
||||
effective_model = resolve_subagent_model_name(config, parent_model, app_config=resolved_app_config)
|
||||
|
||||
# Subagents should not have subagent tools enabled (prevent recursive nesting)
|
||||
parent_context = runtime.context if runtime is not None and isinstance(getattr(runtime, "context", None), dict) else {}
|
||||
roundtable_file_stream = bool(parent_context.get("roundtable_write_file_compatibility"))
|
||||
available_tools_kwargs = {
|
||||
"model_name": effective_model,
|
||||
"groups": parent_tool_groups,
|
||||
@@ -164,7 +166,9 @@ async def task_tool(
|
||||
}
|
||||
if resolved_app_config is not None:
|
||||
available_tools_kwargs["app_config"] = resolved_app_config
|
||||
tools = get_available_tools(**available_tools_kwargs)
|
||||
if roundtable_file_stream:
|
||||
available_tools_kwargs["write_file_compatibility"] = True
|
||||
tools = await get_available_tools_async(**available_tools_kwargs)
|
||||
|
||||
# Create executor
|
||||
executor_kwargs = {
|
||||
@@ -178,6 +182,8 @@ async def task_tool(
|
||||
}
|
||||
if resolved_app_config is not None:
|
||||
executor_kwargs["app_config"] = resolved_app_config
|
||||
if roundtable_file_stream:
|
||||
executor_kwargs["write_file_compatibility"] = True
|
||||
executor = SubagentExecutor(**executor_kwargs)
|
||||
|
||||
# Start background execution (always async to prevent blocking)
|
||||
|
||||
Reference in new issue
Block a user