Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions astrbot/core/agent/handoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def default_parameters(self) -> dict:
"type": "string",
"description": "The input to be handed off to another agent. This should be a clear and concise request or task.",
},
"image_urls": {
"type": "array",
"items": {"type": "string"},
"description": "Optional: An array of image sources (public HTTP URLs or local file paths) used as references in multimodal tasks such as video generation.",
},
"background_task": {
"type": "boolean",
"description": (
Expand Down
10 changes: 9 additions & 1 deletion astrbot/core/astr_agent_tool_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ async def _execute_handoff(
**tool_args,
):
input_ = tool_args.get("input")
image_urls = tool_args.get("image_urls")

# make toolset for the agent
tools = tool.agent.tools
Expand Down Expand Up @@ -143,11 +144,13 @@ async def _execute_handoff(
event=event,
chat_provider_id=prov_id,
prompt=input_,
image_urls=image_urls,
system_prompt=tool.agent.instructions,
tools=toolset,
contexts=contexts,
max_steps=30,
run_hooks=tool.agent.run_hooks,
stream=ctx.get_config().get("provider_settings", {}).get("stream", False),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addition of stream=ctx.get_config().get("provider_settings", {}).get("stream", False) correctly propagates the streaming setting to the tool_loop_agent call. This ensures that sub-agent execution respects the global streaming configuration.

)
yield mcp.types.CallToolResult(
content=[mcp.types.TextContent(type="text", text=llm_resp.completion_text)]
Expand Down Expand Up @@ -314,7 +317,12 @@ async def _wake_main_agent_for_background_result(
message_type=session.message_type,
)
cron_event.role = event.role
config = MainAgentBuildConfig(tool_call_timeout=3600)
config = MainAgentBuildConfig(
tool_call_timeout=3600,
streaming_response=ctx.get_config()
.get("provider_settings", {})
.get("stream", False),
)

req = ProviderRequest()
conv = await _get_session_conv(event=cron_event, plugin_context=ctx)
Expand Down