Files
mesalogo a4b64a1641 feat: preview Agent HTML in conversations and unblock long replies
Agent replies that produced HTML could only be read as source, so users had
to copy the markup into an external file to see the result. Completed Agent
and Subagent output now renders complete HTML documents, single-root HTML
replies, and `html` / `htm` code blocks as an isolated static preview in
place. Each preview keeps a persistent notice that scripts and network are
disabled and offers the same icon actions as Mermaid diagrams: a source
toggle and a full-screen preview. The new "render HTML in conversations"
switch under Platform Features / General is on by default, applies to the
open conversation immediately, and falls back to HTML source when disabled.
Previews cannot run scripts, reach the network, submit forms, open windows,
or load remote media; author stylesheets and inline styles are preserved so
the intended layout survives, and remote resource loading is refused by the
preview CSP instead.

Direct-model replies no longer fail once they grow large. The byte caps on
streaming responses, single stream blocks, non-streaming replies, model tool
arguments, tool request context, aggregate tool results, and accumulated
answer text are removed, so users stop seeing "模型接口流式响应超过安全限制"
on long answers. Response length is now governed by the request timeout,
cancellation, and context compression. Image generation responses keep their
decodable-image validation.

A message sent after a failed or interrupted run stayed in the pending queue
instead of running. The conversation is now released whenever a run reaches
any terminal state, not only when the renderer reports readiness again, and a
dispatched queue item whose run never starts releases its reservation and
returns to pending. Later messages dispatch without extra user action.

Release note: Agent 回复中的 HTML 现在可直接在会话内预览,支持查看源码和全屏预览,默认开启并可在“平台功能 / 通用设置”关闭;直连模型的长回复不再因大小限制中断;上一次运行失败或被中断后,新发送的消息会立即执行而不再排队等待。
2026-09-05 09:10:44 +08:00

1.6 KiB

会话 HTML 渲染

会话 HTML 渲染让用户直接查看 Agent 回复中的网页结果,而不必先复制代码到外部文件。 该能力默认开启,也可以在“设置 > 平台功能 > 通用设置”中关闭。

功能边界

  • 只渲染已完成的 Agent 正文和已完成的子 Agent 输出。
  • 支持完整 HTML 文档、单一 HTML 根元素,以及 Markdown 中的 html / htm 代码块。
  • 使用无脚本、无网络、无表单提交和无窗口操作权限的静态隔离预览。
  • 每个预览提供源码切换和全屏预览两个图标操作;全屏预览沿用同一清理和隔离边界。
  • 用户消息、推理过程和流式中的回复不执行 HTML;关闭功能后继续显示 HTML 源码。
  • 本功能不把普通聊天回复复制为成果,也不替代助手工作栏中独立成果的预览流程。

文档

  • 产品需求:功能范围、状态规则和验收标准。
  • 技术设计:设置持久化、渲染边界与静态隔离方案。
  • 实现进度:已验证实现和验证记录。

术语

  • HTML 源码:Agent 回复中原始、可复制的 HTML 文本。
  • 静态预览:在隔离 iframe 中显示的 HTML;脚本、联网和外部操作均被禁用。
  • 全屏预览:在应用级 Modal 中显示同一份静态预览文档,用于查看完整页面布局。

全局聊天和设置界面规则由根目录的 统一界面设计系统定义。独立成果预览仍由 助手工作栏负责。