fix: incorrect type assignment when the agent send an image (#4050)

This commit is contained in:
Sukafon
2025-12-16 08:28:10 +08:00
committed by GitHub
parent b486de6a98
commit 08244548ab

View File

@@ -188,7 +188,8 @@ class ToolLoopAgentRunner(BaseAgentRunner[TContext]):
if isinstance(result, list):
tool_call_result_blocks = result
elif isinstance(result, MessageChain):
result.type = "tool_call_result"
if result.type is None:
result.type = "tool_call_result"
yield AgentResponse(
type="tool_call_result",
data=AgentResponseData(chain=result),