Merge branch 'feature/mcp-ui' into bot_manager

This commit is contained in:
朱潮 2026-05-15 18:02:34 +08:00
commit cacf31abbe

View File

@ -140,7 +140,14 @@ async def enhanced_generate_stream_response(
elif isinstance(msg, ToolMessage) and msg.content:
message_tag = "TOOL_RESPONSE"
waiting_for_answer_first_char = False
if config.tool_response:
# Always output mcp-ui UIResource responses even when tool_response is disabled
is_ui_resource = (
msg.text
and msg.text.lstrip().startswith('{"type"')
and '"ui://' in msg.text
and '"text/html' in msg.text
)
if config.tool_response or is_ui_resource:
new_content = f"[{message_tag}] {msg.name}\n{msg.text}\n"
# Collect full content