diff --git a/astrbot/core/agent/handoff.py b/astrbot/core/agent/handoff.py index 79a2945cd..8475009d3 100644 --- a/astrbot/core/agent/handoff.py +++ b/astrbot/core/agent/handoff.py @@ -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": ( diff --git a/astrbot/core/astr_agent_tool_exec.py b/astrbot/core/astr_agent_tool_exec.py index 0a8aadb8f..19b451978 100644 --- a/astrbot/core/astr_agent_tool_exec.py +++ b/astrbot/core/astr_agent_tool_exec.py @@ -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 @@ -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), ) yield mcp.types.CallToolResult( content=[mcp.types.TextContent(type="text", text=llm_resp.completion_text)] @@ -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)