Repository navigation
feat(macos): Agent 对话显示工具图片缩略图、点击放大,并将后台任务通知显示为状态行 (#1462) - #1472
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
October 24, 2026 13:21
Lithe Review结论: Findings
Scope Check
Suggestions
Summary实现把图片解析、惰性解码和转录层展示分开放置,并增加了针对解析与通知文本的单元测试。仍需收紧图片计数上限的实际执行时机、避免文件路径缓存产生过期图像,并修正矩阵对 Windows 覆盖范围的表达。没有发现 P0/P1 阻塞问题。 Verification
|
Collaborator
Author
Collaborator
Author
xiaoyumuxi
added a commit
that referenced
this pull request
Oct 24, 2026
- 图片 id 去重,避免 ForEach 重复 id - 指纹改用 SHA-256,避免主线程逐字节循环 - 用户消息解析结果按消息缓存 - 查看器 ←/→ 仅在持有焦点时翻页,拖动限制在画面边缘内 - 只移除消息首尾的模型专用块,不吞用户中间引用的标签 - 图片按原文位置排序,超出上限的引用显示 +N - read 只对存在的文件生成缩略图,解码失败显示占位 - 缓存限制成本,键含修改时间,解码任务随行取消 - 内联数据须能被 ImageIO 识别,否则退回文字条目 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- 图片 id 去重,避免 ForEach 重复 id - 指纹改用 SHA-256,避免主线程逐字节循环 - 用户消息解析结果按消息缓存 - 查看器 ←/→ 仅在持有焦点时翻页,拖动限制在画面边缘内 - 只移除消息首尾的模型专用块,不吞用户中间引用的标签 - 图片按原文位置排序,超出上限的引用显示 +N - read 只对存在的文件生成缩略图,解码失败显示占位 - 缓存限制成本,键含修改时间,解码任务随行取消 - 内联数据须能被 ImageIO 识别,否则退回文字条目
xiaoyumuxi
force-pushed
the
feat/1462-agent-display-images
branch
from
October 24, 2026 14:58
3ce110b to
6451723
Compare
- 成功的后台任务通知不再单独成行,进入随后一轮的折叠“思考过程”;失败、被终止或后面没有过程的通知仍显示 - Claude 的英文 shell 任务摘要按界面语言显示(后台命令已完成:…) - Rust 宿主在 session/load 前只读取会话文件中最后一个压缩点之前的记录,转成回放更新,压缩前的用户消息、回复、思考和工具调用都能查看 - 读取范围:只读 projects/*/<会话 id>.jsonl,按所选账号目录解析,大小和条数有上限 - 新增翻译放在 shared/i18n,更新功能矩阵与 Agent Note Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
连续的用户消息(例如后台通知后紧跟用户输入)在回放时被拼成一个气泡,导致通知标记无法识别而显示原文。 按上游 messageId 区分用户消息;压缩前的历史也带上记录 uuid。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- 宿主把 mcp__ccd_turn__wrap_up 改写成 Agent 回复,吞掉其后续 tool_call_update - 宿主把 mcp__ccd_turn__update_plan(整表/增量)改写成完整 ACP plan 更新 - 压缩前文回放补上对话中途排队的用户消息(queued_command),工具调用带上 name - 历史回放时计划快照作为清单显示在折叠过程之间,导出为任务列表,不计入消息数 - 折叠的过程标题附工具摘要(如运行了 N 条命令)
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.




Refs #1462
改动点
image内容块不再丢弃。工具行和工具组标题右侧显示缩略图,最多 3 张,其余以+N表示(最新的在右)。只给出路径的read工具调用(图片文件)直接显示该文件。折叠的“思考过程”标题行右侧也显示缩略图,否则默认折叠时看不到。workbenchHoverCard,显示大图、标题和“第 i 项,共 n 项”。📎 路径、[@名字](file:///路径)、裸file://地址和 Claude Code 的[Image: source: …]指向图片文件时显示为缩略图并可放大;[Image: original …]尺寸说明去掉;其余文字保持不变。<task-notification>、斜杠命令、本地命令输出、Shell 转义、中断提示:状态行或输出块<system-reminder>、<local-command-caveat>等只给模型看的块:不显示(接在用户文字后面时只去掉该块)后台命令已完成:…),新增翻译在shared/i18n。session/load前只读取会话文件中最后一个压缩点之前的记录,转成与回放一致的更新,每次压缩处显示“对话已从摘要继续”。这是对“宿主不读转录文件”约定的有限例外:只读projects/*/<会话 id>.jsonl(按所选账号目录解析),不碰登录信息、不写入、不缓存;超过 128 MiB 的文件跳过,最多 30000 条更新,工具输入输出截断;解析失败只是不显示更早历史。边界与理由写进 Agent Note。shared/i18n并重新生成。agent-tool-activity-timeline与 Agent Note(Windows 待对齐)。关于 issue 第 2 项(多余复制按钮)
当前
preview上 #1464 已把过程说明收进默认折叠的过程区,空白回复也不再生成行,截图场景不再出现,所以本 PR 没有改复制按钮规则。验证
claude_earlier_history(4 项)和 Swift 测试(后台通知分组、失败/孤立通知保持可见、摘要改写);lithe-agent-host全部 238 项通过,聚焦的 78 项 Swift 测试通过AgentImageTests14 项)通过verify-agent-notes.sh、verify-platform-feature-matrix.sh、矩阵变更门禁、verify-service-boundaries.sh、测试稳定性静态检查、i18n 检查均通过package-app.sh打包并启动过本地实例,真实 Agent 会话中的悬停、缩放和格式显示仍需评审者手动确认;Windows 未实现兼容 Claude Desktop 开始的会话(00f503dca)
Desktop 会话里模型几乎不直接输出文字,压缩前的段落在 Lithe 里只剩折叠的“思考过程”。本次改动:
claude_desktop.rs,把mcp__ccd_turn__wrap_up的recap/ask改写成 Agent 回复,并吞掉该调用后续的tool_call_updateitems)和增量(done/start/advance)调用都改写成完整的 ACPplan更新;增量调用之前没有整表时保持原样。适配器回放和压缩前文回放都走这条路径,Windows 共用同一个宿主queued_commandattachment),工具调用带上name验证:
cargo test -p lithe-agent-host(242 通过)、AgentImageTests和AgentHistoryTests(58 通过)、verify-agent-notes.sh、verify-test-stability.sh