feat(chat): surface generated file artifacts in run-overview rail (#384)#447
Conversation
SuperCoderMan521
commented
Jun 28, 2026
- Backend: extract generated-file markdown links from tool results in StreamAccumulator and attach them to message metadata
- Frontend: parse generated-file links in SSE tool_result handler, de-duplicate by URL, and expose via metadata.generatedFiles
- RunOverviewPanel: new "Generated Files" section with file-type color-coded icons (docx/xlsx/pptx/pdf/image), clickable download links, and rail badge counter
- Types: add GeneratedFile interface and generatedFiles to MessageMetadata
- i18n: add en-US/zh-CN labels for generated files section
…teaix#384) - Backend: extract generated-file markdown links from tool results in StreamAccumulator and attach them to message metadata - Frontend: parse generated-file links in SSE tool_result handler, de-duplicate by URL, and expose via metadata.generatedFiles - RunOverviewPanel: new "Generated Files" section with file-type color-coded icons (docx/xlsx/pptx/pdf/image), clickable download links, and rail badge counter - Types: add GeneratedFile interface and generatedFiles to MessageMetadata - i18n: add en-US/zh-CN labels for generated files section
|
surface generated file artifacts in run-overview rail |
|
感谢贡献 🙏 后端持久化(写入 message metadata,刷新后历史也能展示)+ 前端 SSE 实时解析的双路设计、按 URL 去重、 有两点 follow-up(其中一个是安全加固),我在下一条评论里详细说明,麻烦后续用一个小 PR 跟进 🙏 |
|
已合并 ✅ 以下是 follow-up,麻烦用一个小 PR 跟进 🙏 1.(安全 + 复用)链接正则过于宽松,建议改用仓库已有的规范写法当前两端用的是:
仓库里同包的 只允许「可选的 参考改法:
2.(规范)内联全限定名
3.(小)未使用的 i18n key
谢谢!其中第 1 条是安全项,建议优先。 |
Follow-up to #447. The generated-file link extraction accepted any non-')' text before the path, so a paren-free javascript:/data: URL embedding /api/v1/files/generated/<id> could be captured and bound to an <a href>, enabling XSS on click. Adopt the scheme-restricted pattern already used by SegmentSupersedeDetector and the channel adapters, on both backend (ChatController) and frontend (useChat). Also replace the inline fully-qualified Pattern/Matcher with imports and drop an unused run-overview i18n key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
补充:上面 follow-up 里的第 1 条(安全加固)和第 2、3 条(内联 FQN、未使用 i18n key)我已经直接在 你这边不用再重复改了,感谢贡献 🙏 |
Follow-up to #447. The generated-file link extraction accepted any non-')' text before the path, so a paren-free javascript:/data: URL embedding /api/v1/files/generated/<id> could be captured and bound to an <a href>, enabling XSS on click. Adopt the scheme-restricted pattern already used by SegmentSupersedeDetector and the channel adapters, on both backend (ChatController) and frontend (useChat). Also replace the inline fully-qualified Pattern/Matcher with imports and drop an unused run-overview i18n key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>