opencode-acp 1.12.0 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -422,6 +422,22 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
422
422
 
423
423
  ## Changelog
424
424
 
425
+ ### v1.12.2 — Compress Failure Rollback + Sync Carve-out Removal (PR #126)
426
+
427
+ **Problem**: Two bugs in post-compression-failure handling (issue #125). (1) The compress tool mutated in-memory state incrementally with no try/catch — if anything threw between the first `applyCompressionState` and `finalizeSession`, "ghost blocks" (active blocks never persisted) hid messages on subsequent transforms. (2) `syncCompressionBlocks` had a carve-out that kept blocks active when the anchor was missing from messages but tracked in `byMessageId`. This carve-out was intended for ACP-hidden anchors, but sync runs on the raw message list (before filtering), so it only triggered for externally-deleted anchors → messages hidden without recap injection → empty LLM requests.
428
+
429
+ **Fix**: (1) Added `snapshotCompressionState()` / `restoreCompressionState()` to `lib/compress/pipeline.ts` using `structuredClone`. Wrapped the mutation phase in try/catch in both `lib/compress/range.ts` and `lib/compress/message.ts`. On failure, state (including `manualMode`) is restored to the pre-mutation snapshot — no ghost blocks. (2) Removed the carve-out in `lib/messages/sync.ts`. When anchor is gone from messages, always deactivate the block. Oracle-reviewed.
430
+
431
+ Files: `lib/messages/sync.ts`, `lib/compress/pipeline.ts`, `lib/compress/range.ts`, `lib/compress/message.ts`. Tests: `tests/sync.test.ts` (updated), `tests/compress-rollback.test.ts` (NEW, 4 tests). 643 tests pass.
432
+
433
+ ### v1.12.1 — Compression Recap Injection Fix + Stale Compress Stripping (PR #119)
434
+
435
+ **Problem**: `acp_context_recap` was used to create synthetic tool-result recap messages but was NOT registered as a real tool — providers could strip/convert unregistered tool-results, causing the model to see compression summaries as plain text or user messages (echo/drift bugs). Additionally, compress tool-call inputs duplicated block recap content in context.
436
+
437
+ **Fix**: Register `acp_context_recap` as a real tool (`lib/compress/recap.ts`) so providers properly serialize tool-results. Add `stripStaleCompressCalls` (`lib/messages/prune.ts`) to remove compress tool-call parts from previous turns. Also fixes: KEEP/REF regex normalization (`m150` → `m00150`), `resolveKeepMarkers` in message mode, toast notification `replace()` failure, notification range display (`→ Range: b20: m00150–m00155`), proportional baseline adjustment after compress, and reverts the problematic `postCompressRangesShown` feature.
438
+
439
+ Files: `lib/compress/recap.ts` (NEW), `lib/messages/prune.ts`, `lib/compress/keep-markers.ts`, `lib/compress/message.ts`, `lib/messages/inject/inject.ts`, `lib/ui/notification.ts`. Tests: `tests/strip-stale-compress.test.ts` (NEW, 7 tests). Oracle-reviewed.
440
+
425
441
  ### v1.12.0 — Baseline Leak Fix + KEEP/REF Markers + Compressible Ranges (PR #115)
426
442
 
427
443
  Comprehensive fix for issue #23 (context memory leak). 7 commits, 22 files, 851 insertions, 327 deletions.
package/README.zh-CN.md CHANGED
@@ -395,6 +395,22 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
395
395
 
396
396
  ## 更新日志
397
397
 
398
+ ### v1.12.2 — 压缩失败回滚 + Sync carve-out 移除(PR #126)
399
+
400
+ **问题**:压缩失败后的处理存在两个 bug(issue #125)。(1)compress 工具在内存中增量修改状态,没有 try/catch——如果在 `applyCompressionState` 和 `finalizeSession` 之间抛出异常,"幽灵块"(未持久化的活跃块)会在后续 transform 中隐藏消息。(2)`syncCompressionBlocks` 有一个 carve-out:当块的锚点从消息中缺失但在 `byMessageId` 中有记录时,块保持活跃。这个 carve-out 本意是保护 ACP 隐藏的锚点,但 sync 运行在原始消息列表上(在过滤之前),所以它只在外部删除的锚点场景触发 → 块保持活跃但无法注入摘要 → 隐藏消息无替换 → **LLM 请求为空**。
401
+
402
+ **修复**:(1)在 `lib/compress/pipeline.ts` 中新增 `snapshotCompressionState()` / `restoreCompressionState()`(使用 `structuredClone`)。在 `lib/compress/range.ts` 和 `lib/compress/message.ts` 中用 try/catch 包裹变更阶段。失败时,状态(包括 `manualMode`)恢复到变更前的快照——不会有幽灵块。(2)移除 `lib/messages/sync.ts` 中的 carve-out。锚点从消息中缺失时,总是停用块。经 Oracle 审查。
403
+
404
+ 文件:`lib/messages/sync.ts`、`lib/compress/pipeline.ts`、`lib/compress/range.ts`、`lib/compress/message.ts`。测试:`tests/sync.test.ts`(更新)、`tests/compress-rollback.test.ts`(新增,4 个测试)。643 个测试通过。
405
+
406
+ ### v1.12.1 — 压缩摘要注入修复 + 历史压缩调用剥离(PR #119)
407
+
408
+ **问题**:`acp_context_recap` 用于创建合成的 tool-result 摘要消息,但未注册为真实工具——provider 可能剥离/转换未注册的 tool-result,导致模型将压缩摘要视为纯文本或用户消息(回声/漂移 bug)。此外,compress 工具调用的输入与 block recap 内容重复占用上下文。
409
+
410
+ **修复**:将 `acp_context_recap` 注册为真实工具(`lib/compress/recap.ts`),使 provider 正确序列化 tool-result。新增 `stripStaleCompressCalls`(`lib/messages/prune.ts`),剥离历史轮次的 compress 工具调用部分。同时修复:KEEP/REF 正则归一化(`m150` → `m00150`)、message 模式下 `resolveKeepMarkers` 调用、toast 通知 `replace()` 失败、通知范围显示(`→ Range: b20: m00150–m00155`)、压缩后比例基线调整,并回退了有问题的 `postCompressRangesShown` 功能。
411
+
412
+ 文件:`lib/compress/recap.ts`(新增)、`lib/messages/prune.ts`、`lib/compress/keep-markers.ts`、`lib/compress/message.ts`、`lib/messages/inject/inject.ts`、`lib/ui/notification.ts`。测试:`tests/strip-stale-compress.test.ts`(新增,7 个测试)。经 Oracle 审查。
413
+
398
414
  ### v1.12.0 — 基线泄露修复 + KEEP/REF 标记 + 可压缩范围(PR #115)
399
415
 
400
416
  Issue #23(上下文内存泄露)的综合修复。7 个 commit,22 个文件,851 行新增,327 行删除。
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA4BjD,QAAA,MAAM,MAAM,EAAE,MAsHK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA6BjD,QAAA,MAAM,MAAM,EAAE,MAuHK,CAAA;AAEnB,eAAe,MAAM,CAAA"}