Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

docs(adr): renumber the compaction decision to D617 and mirror it in zh-CN

vastsa469c4889e31d
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index d80ab0b25..86b09dcd7 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -6596,7 +6596,7 @@ that was sitting at the bottom — including after the turn had finished.
`apps/desktop/test/image-generation-default.test.mjs`, with
`provider-model-config.test.mjs` asserting the add branch consults them.
-## 2026-09-22 — A failed compaction keeps the recent window (D613, issue #827)
+## 2026-09-22 — A failed compaction keeps the recent window (D617, issue #827)
- An automatic compaction whose summary request failed installed a
retained-tail checkpoint that carried at most the latest user message, and a
diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.md
index cb3a1f969..274206c1a 100644
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@ -4677,3 +4677,20 @@ that amendment are retired by ADR 0268; the upstream work-panel lifecycle stays.
`apps/desktop/test/default-model-display.test.mjs` 与
`apps/desktop/test/image-generation-default.test.mjs` 固定,
`provider-model-config.test.mjs` 断言新增分支会走这两个判断。
+
+## 2026-09-22 —— 摘要失败的压缩保留真实近期窗口(D617,issue #827)
+
+- 自动压缩的摘要请求失败时安装的保留尾部检查点最多只带一条最新用户消息,重建存储的
+ 检查点也会以同样方式收窄尾部。于是在一条长回合里,下一次模型请求只剩一句用户话:
+ 报告中的会话在两次检查点之间丢掉约 168 条消息(3 条用户 / 34 条助手 / 131 条工具),
+ 而磁盘上的转录本与界面行看起来完好。
+- 回退现在保留真实的近期窗口——压缩范围内最新的连续消息,包含所有角色,上限为
+ keep-recent 目标,以及携带摘要与恢复提示之后安全预算剩余的空间——并用
+ `details.retainedTailShape` 标记,使重建时回放整窗。没有该标记的检查点(每个成功
+ 检查点,以及标记出现之前写入的记录)仍归一化为只保留最新的用户消息。`active_turn`
+ 回退还会在窗口装不下时保留当前任务的用户消息;回退会丢弃 pi 本来就会丢的助手消息,
+ 以及调用不在窗口内的工具结果;`details.failureReason` 记录 `no_new_history` /
+ `summary_budget` / `summary_provider` / `checkpoint_oversized`,而不是提供商错误文本。
+- 单次缩减后仍过大的摘要提示不再被跳过:范围会被切成每片都能放下的连续分片,最多 16 次
+ 请求,每次携带上一片的摘要,检查点报告这些请求的用量总和。只有空范围或超过该请求上限
+ 的范围才因预算原因回退。见 ADR 0301、`03-runtime/02-agent-runtime.md`、ADR 0049、ADR 0282。