fix(image-generation): let LLM deliver images via message tool instead of runtime media attachment
The runtime media-attachment mechanism was broken for streaming channels (e.g. WebSocket): the _streamed flag caused _send_once to skip the final OutboundMessage that carried generated media, so images were never delivered. Rather than adding complex coordination between streaming and media delivery, delegate image delivery to the LLM: after generate_image returns artifact paths, the next_step prompt now instructs the LLM to call the message tool with the paths in the media parameter. This works uniformly across all channels, streaming or not. Remove generated_media from TurnContext, _assemble_outbound, and _state_save. Update prompts in identity.md, SKILL.md, message tool description, and artifacts.py to reflect the new flow.
This commit is contained in:
@@ -140,8 +140,8 @@ class MessageTool(Tool, ContextAware):
|
||||
"Do not use this for the normal reply in the current chat: answer naturally instead. "
|
||||
"If channel/chat_id would target the current runtime conversation, do not call this tool "
|
||||
"unless the user explicitly asked you to proactively send an existing file attachment. "
|
||||
"When generate_image creates images in the current chat, the final assistant reply "
|
||||
"automatically attaches them; do not call message just to announce or resend them. "
|
||||
"When generate_image creates images in the current chat, use the message tool "
|
||||
"with the artifact paths in the media parameter to deliver the images to the user. "
|
||||
"For proactive attachment delivery, use the 'media' parameter with file paths. "
|
||||
"Do NOT use read_file to send files — that only reads content for your own analysis."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user