Repository navigation
Conversation
模型过去只能在文字里描述图片,用户看不到它刚截的那张。现在可以把工作区或附件里的 图片登记成「回复图片」,UI 用现成的 attachment-preview 通道按 id 取 dataUrl 渲染。 刻意没做成 Markdown 的 :那条路径会把 base64 写进 .agent-history.json, 直接破坏「历史不落 base64」这个既有不变量。历史里只记附件 id,和其他附件共用同一套 存储与校验。 安全边界:模型能决定用户屏幕上出现什么图(伪造登录框/系统提示都是现实的钓鱼面), 所以 - 不接受远端 URL,只接受工作区相对路径; - 不接受 SVG(可内嵌脚本),一律按文件头真实嗅探格式; - 复用已有附件时重新校验 hash,防止「登记后文件被换掉」。 - sidecar/reply-image.mjs:登记与校验;sidecar/reply-tools.mjs:reply_image 工具。 - ui/src/reply-markdown.jsx + image-refs.js:把回复里的图片引用切出来单独渲染。 - scripts/check-reply-images.mjs:UI 回归。 验证:node --test sidecar/test/reply-image.test.mjs → 7 项全过。
Contributor
Author
|
已被 #18 取代并收敛为单一 PR:内容全部包含在 feat/paste-and-seat 中,且修掉了合并时被静默回退的 CI 加固与思考块跨刷新展开的冲突。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
基于
feat/desktop-stack(#16)。这个 PR 的 base 是feat/desktop-stack,不是main—— #16 合了之后它才能进 main,避免重复解同一批 UI 冲突。为什么这么做
模型过去只能在文字里描述图片,用户看不到它刚截的那张。现在可以把工作区或附件里的图片登记成「回复图片」,UI 用现成的 attachment-preview 通道按 id 取 dataUrl 渲染。
刻意没做成 Markdown 的
:那条路径会把 base64 写进.agent-history.json,直接破坏「历史不落 base64」这个既有不变量。历史里只记附件 id,和其他附件共用同一套存储与校验。安全边界
模型能决定用户屏幕上出现什么图 —— 伪造登录框、伪造系统提示都是现实存在的钓鱼面。所以:
改动
sidecar/reply-image.mjssidecar/reply-tools.mjsreply_image工具ui/src/reply-markdown.jsxui/src/image-refs.jsimage:<id>引用解析scripts/check-reply-images.mjssidecar/browsertools.mjstake_screenshot的 image block顺手修的一个缺陷
ReplyMarkdown声明了streaming参数但没有透传给Markdown—— 一旦回复里带图,流式渲染会退化成每个 token 重建 DOM,正是 #16 里刚修掉的「打字机效果时文字在闪」。本 PR 补齐了参数传递,并在chat.jsx同时传streaming与images。验证
含新增
sidecar/test/reply-image.test.mjs7 项:只读分类、只收工作区图片、复用附件重校验 hash、历史不落 base64、工具事件只存 id、截图块能进回复、splitImageRefs不误伤其他 markdown。