Skip to content

Commit b8728cd

Browse files
committed
fix: 修复5081号PR在子代理执行后台任务时,未正确使用系统配置的流式/非流请求的问题(AstrBotDevs#5081)
1 parent 94736ff commit b8728cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

astrbot/core/astr_agent_tool_exec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ async def _execute_handoff(
148148
contexts=contexts,
149149
max_steps=30,
150150
run_hooks=tool.agent.run_hooks,
151+
stream=ctx.get_config().get("provider_settings", {}).get("stream", False),
151152
)
152153
yield mcp.types.CallToolResult(
153154
content=[mcp.types.TextContent(type="text", text=llm_resp.completion_text)]
@@ -314,7 +315,7 @@ async def _wake_main_agent_for_background_result(
314315
message_type=session.message_type,
315316
)
316317
cron_event.role = event.role
317-
config = MainAgentBuildConfig(tool_call_timeout=3600)
318+
config = MainAgentBuildConfig(tool_call_timeout=3600, streaming_response=ctx.get_config().get("provider_settings", {}).get("stream", False))
318319

319320
req = ProviderRequest()
320321
conv = await _get_session_conv(event=cron_event, plugin_context=ctx)

0 commit comments

Comments
 (0)