Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
docs(adr): renumber the compaction ADR to 0302 after main took 0301
vastsa1064f7bc9e40
diff --git a/docs/adr/0049-context-compaction-failure-recovery.md b/docs/adr/0049-context-compaction-failure-recovery.mdindex ea426e7d9..2383bad5a 100644--- a/docs/adr/0049-context-compaction-failure-recovery.md+++ b/docs/adr/0049-context-compaction-failure-recovery.md@@ -9,7 +9,7 @@no summary request, so this path cannot trigger there) / ADR 0282 (thesummary request retries transient failures and the preflight guard sizesthe serialized prompt, with one reduced pass, before this fallback runs) /- ADR 0301 (the fallback keeps the real recent window rather than one user+ ADR 0302 (the fallback keeps the real recent window rather than one user## Contextdiff --git a/docs/adr/0282-compaction-summary-retry-and-sizing.md b/docs/adr/0282-compaction-summary-retry-and-sizing.mdindex bc8f4d369..27e5a0572 100644--- a/docs/adr/0282-compaction-summary-retry-and-sizing.md+++ b/docs/adr/0282-compaction-summary-retry-and-sizing.md@@ -5,7 +5,7 @@- Deciders: PI-Desktop runtime maintainers- Amends: ADR 0049 (decision 1, the preflight guard; the "retry indefinitely"rejection stands), D203 / ADR 0064 (the summary family only)-- Amended by: ADR 0301 (a prompt that still does not fit after the reduced pass+- Amended by: ADR 0302 (a prompt that still does not fit after the reduced passis summarized in chunks; only a range the planner cannot split falls back)- Related: issue #543 · PR #554 (superseded) ·[03-runtime/02-agent-runtime](../spec/03-runtime/02-agent-runtime.md) ·diff --git a/docs/adr/0301-compaction-fallback-recent-window-and-chunked-summary.md b/docs/adr/0302-compaction-fallback-recent-window-and-chunked-summary.mdsimilarity index 98%rename from docs/adr/0301-compaction-fallback-recent-window-and-chunked-summary.mdrename to docs/adr/0302-compaction-fallback-recent-window-and-chunked-summary.mdindex 8a8e37026..48348bc16 100644--- a/docs/adr/0301-compaction-fallback-recent-window-and-chunked-summary.md+++ b/docs/adr/0302-compaction-fallback-recent-window-and-chunked-summary.md@@ -1,4 +1,4 @@-# ADR 0301: A failed compaction keeps the recent window, and an oversized summary is chunked+# ADR 0302: A failed compaction keeps the recent window, and an oversized summary is chunked- Status: Accepted for implementation- Date: 2026-09-22diff --git a/docs/adr/README.md b/docs/adr/README.mdindex d2a79cc6a..07271915d 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -329,7 +329,7 @@ Each ADR includes:| 0298 | [The app ships no fonts](0298-remove-bundled-fonts.md) | Accepted (D598; amends ADR 0083 / D232) || 0299 | [Subagent context budget and delegate compaction](0299-subagent-context-budget.md) | Accepted for implementation (amends ADR 0064; extends ADR 0062 / ADR 0279) || 0300 | [Host-owned encrypted portable configuration sync](0300-host-owned-encrypted-portable-configuration-sync.md) | Accepted for implementation |-| 0301 | [A failed compaction keeps the recent window, and an oversized summary is chunked](0301-compaction-fallback-recent-window-and-chunked-summary.md) | Accepted for implementation (issue #827; amends ADR 0049 / ADR 0282) |+| 0302 | [A failed compaction keeps the recent window, and an oversized summary is chunked](0302-compaction-fallback-recent-window-and-chunked-summary.md) | Accepted for implementation (issue #827; amends ADR 0049 / ADR 0282) || turn-process-and-thinking-display | [Turn process and thinking presentation](turn-process-and-thinking-display.md) | Accepted || provider-display-order | [Provider display order](provider-display-order.md) | Accepted || registry-header-variable-spelling | [Remote header variables accept the registry's `{name}` spelling](registry-header-variable-spelling.md) | Proposed |diff --git a/docs/spec/03-runtime/02-agent-runtime.md b/docs/spec/03-runtime/02-agent-runtime.mdindex 747f0b330..1a5090e81 100644--- a/docs/spec/03-runtime/02-agent-runtime.md+++ b/docs/spec/03-runtime/02-agent-runtime.md@@ -406,7 +406,7 @@ For every pi loop turn:summary family, generation is mandatory; the runtime preflights the summaryinput against the model window, reduces it once, and then splits a range thatstill does not fit into chunks that each do, so a prompt too large for one- request is summarized by several (ADR 0301). An automatic summary failure+ request is summarized by several (ADR 0302). An automatic summary failurefirst attempts a deterministic retained-tail checkpoint, while manualcompaction still reports `CONTEXT_COMPACTION_FAILED`5. successful generation or deterministic recovery first appends the@@ -436,7 +436,7 @@ compacted range, every role, bounded by the keep-recent target and by what thesafe budget leaves once the carried-forward summary and the recovery notice arepaid for — and records `details.retainedTailShape` as `recent_window`, so arebuild replays that window instead of narrowing it back to one user message-(ADR 0301, issue #827). It drops the assistant messages pi drops from the+(ADR 0302, issue #827). It drops the assistant messages pi drops from therebuilt context anyway (error, aborted, deferred) and any tool result whose toolcall is not in the window, because a provider rejects a result whose call ismissing. An `active_turn` fallback also keeps the active task's user message@@ -551,7 +551,7 @@ is split into contiguous chunks that each do: at most 16 requests, each carryingthe previous chunk's summary through pi's update-the-summary prompt, with therange's file list appended on the last one, and the checkpoint reports the summedusage of the requests that produced it. A budget therefore decides how many-requests a summary takes, not whether the model is asked at all (ADR 0301); only+requests a summary takes, not whether the model is asked at all (ADR 0302); onlyan empty range, or one past that request bound, still gives up on the summary(ADR 0282). If normal compaction still fails during an automatic threshold oroverflow recovery, the runtime persists a short recovery checkpoint with thediff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 86b09dcd7..43ffa8461 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -6620,4 +6620,4 @@ that was sitting at the bottom — including after the turn had finished.most 16 requests, each carrying the previous chunk's summary, and thecheckpoint reports the summed usage of the requests that produced it. Only anempty range, or one past that request bound, still falls back on budget- grounds. See ADR 0301, `03-runtime/02-agent-runtime.md`, ADR 0049, ADR 0282.+ grounds. See ADR 0302, `03-runtime/02-agent-runtime.md`, ADR 0049, ADR 0282.diff --git a/docs/zh-CN/spec/03-runtime/02-agent-runtime.md b/docs/zh-CN/spec/03-runtime/02-agent-runtime.mdindex 740a69fd0..c65d10e2f 100644--- a/docs/zh-CN/spec/03-runtime/02-agent-runtime.md+++ b/docs/zh-CN/spec/03-runtime/02-agent-runtime.md@@ -306,7 +306,7 @@ pi 0.84.4+ 只在循环将要在同一次运行中开启另一个助手回合时压缩在下一个提供程序请求之前同步运行。在在 summary 系列中,生成摘要是强制的;运行时会拿摘要输入对照模型窗口做预检、缩减一次,再把仍放不下的范围切成若干分片分别摘要,因此超出单次请求的- 提示由多次请求完成(ADR 0301)。自动摘要失败时先尝试一个确定性的保留尾部+ 提示由多次请求完成(ADR 0302)。自动摘要失败时先尝试一个确定性的保留尾部检查点,而手动压缩仍然报告`CONTEXT_COMPACTION_FAILED`5. 成功生成或确定性恢复首先追加@@ -334,7 +334,7 @@ pi 0.84.4+ 只在循环将要在同一次运行中开启另一个助手回合时压缩范围内最新的连续消息,包含所有角色,上限为 keep-recent 目标,以及在携带摘要与恢复提示之后安全预算剩余的空间——并把`details.retainedTailShape` 记录为 `recent_window`,使重建时回放整个窗口,-而不是收窄回一条用户消息(ADR 0301,issue #827)。它会丢弃 pi 本来就会从+而不是收窄回一条用户消息(ADR 0302,issue #827)。它会丢弃 pi 本来就会从重建上下文中移除的助手消息(error、aborted、deferred),以及工具调用不在窗口内的工具结果,因为提供商拒绝调用缺失的结果。`active_turn` 回退还会在窗口本身装不下时,把当前任务的用户消息放在窗口之前,因此续写不会丢失目标。@@ -415,7 +415,7 @@ Headroom 是 16,384 个代币储备底线的最大值,模型最大输出不删除任何消息)。若连缩减后的输入也放不下,就把范围切成若干连续分片,使每片都能放下:最多 16 次请求,每次通过 pi 的 update-the-summary 提示携带上一片的摘要,该范围的文件列表只追加在最后一次请求上,检查点报告这些请求的用量总和。-因此预算决定一次摘要需要多少次请求,而不是决定是否调用模型(ADR 0301);+因此预算决定一次摘要需要多少次请求,而不是决定是否调用模型(ADR 0302);只有空范围或超过该请求上限的范围才会放弃摘要(ADR 0282)。如果在自动阈值或溢出恢复期间正常压缩仍然失败,运行时会持久化一个简短的恢复检查点,携带之前的摘要(如可用)diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex 274206c1a..86ec8956e 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -4693,4 +4693,4 @@ that amendment are retired by ADR 0268; the upstream work-panel lifecycle stays.`summary_budget` / `summary_provider` / `checkpoint_oversized`,而不是提供商错误文本。- 单次缩减后仍过大的摘要提示不再被跳过:范围会被切成每片都能放下的连续分片,最多 16 次请求,每次携带上一片的摘要,检查点报告这些请求的用量总和。只有空范围或超过该请求上限- 的范围才因预算原因回退。见 ADR 0301、`03-runtime/02-agent-runtime.md`、ADR 0049、ADR 0282。+ 的范围才因预算原因回退。见 ADR 0302、`03-runtime/02-agent-runtime.md`、ADR 0049、ADR 0282。