Repository navigation
feat(core): #1662 第二轮 Agent 附件保留(AGT-06) - #1765
Merged
Merged
Conversation
新增 agent.attachments.retentionPlan:被会话接受的引用永不删除,放弃或失败的粘贴立即删除,未引用且超过 7 天的删除。macOS 和 Windows 删除各自的清理规则,只列目录、记录已接受引用的账本并执行 Core 返回的删除。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core 计划新增 ledgerPresent 输入和 seed 输出:只看账本文件是否存在,缺失时把现有的非放弃图片全部作为已接受引用并返回 seed,两端在删除前原子写入账本(临时文件加 rename)。账本存在但为空不再触发迁移。fixture 补两端共用的用例,Windows 补 fs rename 权限。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
本地集成验证(#1662 第二轮)本 PR 与 #1765、#1768、#1767、#1766、#1769 一起,在本地集成分支 Rust
校验脚本 macOS
Windows 前端(在 Mac 上用 bun 跑)
未执行 验证通过后用 |
This was referenced Nov 5, 2026
1lck
marked this pull request as ready for review
November 5, 2026 13:56
This was referenced Nov 5, 2026
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.
Issue #1662 第二轮【Agent 附件】车道,条目 AGT-06。
改了什么
agent.attachments.retentionPlan(纯函数,在lithe-agent-host::attachment_retention,由 lithe-core 分发):输入缓存清单、已接受引用集合、当前时间,输出delete/keep,每项带原因。规则:被引用则保留(即使被标记放弃);放弃或失败的粘贴删除;未引用且超过 7 天删除;修改时间未知不过期。路径比较统一分隔符,Windows 另外不分大小写。shared/fixtures/agent/attachment-retention-v1.json,shared/contracts/rust-core-api.md补充说明。Caches/AgentAcceptedAttachments.json,WindowsappCacheDir/agent/pasted-images-accepted.json),发送被接受后追加(只记缓存目录内的文件,同时丢掉已不存在的文件)。不在 app bundle、安装目录,不跨 worktree。两端行为变化
AgentConversationView->recordAcceptedAgentAttachments)。recordAcceptedPastedImages)。新增 Core API
agent.attachments.retentionPlan撤出的条目
无。
验证
cargo test -p lithe-core --lib agent通过;cargo test -p lithe-agent-host -- --test-threads=2通过(首轮曾有 1 个偶发失败,重跑 270 通过)。bun run typecheck通过;tests/agent-pasted-images.test.ts(6 项,含 fixture 驱动的启动清理和账本)与agent-composer.escape.test.tsx通过。swift build --build-tests通过;test-macos.sh --filter AgentAttachmentRetention(链接真实 Core,对照共享 fixture)通过。generate-i18n.mjs --check通过。未执行
verify-runtime-bundle-immutability.sh(本改动只写 Caches,未跑);cargo check --bin lithe-windows(未改 Windows Rust 代码)。关联 #1662
🤖 Generated with Claude Code