opencode-acp 1.11.4 → 1.12.1
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 +26 -0
- package/README.zh-CN.md +26 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +550 -210
- package/dist/index.js.map +1 -1
- package/dist/lib/compress/index.d.ts +1 -0
- package/dist/lib/compress/index.d.ts.map +1 -1
- package/dist/lib/compress/keep-markers.d.ts +11 -0
- package/dist/lib/compress/keep-markers.d.ts.map +1 -0
- package/dist/lib/compress/message.d.ts.map +1 -1
- package/dist/lib/compress/range.d.ts.map +1 -1
- package/dist/lib/compress/recap.d.ts +4 -0
- package/dist/lib/compress/recap.d.ts.map +1 -0
- package/dist/lib/compress/status.d.ts.map +1 -1
- package/dist/lib/config-validation.d.ts.map +1 -1
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/messages/index.d.ts +1 -1
- package/dist/lib/messages/index.d.ts.map +1 -1
- package/dist/lib/messages/inject/inject.d.ts +1 -1
- package/dist/lib/messages/inject/inject.d.ts.map +1 -1
- package/dist/lib/messages/inject/utils.d.ts +10 -0
- package/dist/lib/messages/inject/utils.d.ts.map +1 -1
- package/dist/lib/messages/prune.d.ts +1 -0
- package/dist/lib/messages/prune.d.ts.map +1 -1
- package/dist/lib/prompts/compress-range.d.ts +1 -1
- package/dist/lib/prompts/compress-range.d.ts.map +1 -1
- package/dist/lib/prompts/compression-rules.d.ts +7 -1
- package/dist/lib/prompts/compression-rules.d.ts.map +1 -1
- package/dist/lib/prompts/context-limit-nudge.d.ts +1 -1
- package/dist/lib/prompts/context-limit-nudge.d.ts.map +1 -1
- package/dist/lib/prompts/iteration-nudge.d.ts +1 -1
- package/dist/lib/prompts/iteration-nudge.d.ts.map +1 -1
- package/dist/lib/prompts/system.d.ts +1 -1
- package/dist/lib/prompts/system.d.ts.map +1 -1
- package/dist/lib/prompts/turn-nudge.d.ts +1 -1
- package/dist/lib/prompts/turn-nudge.d.ts.map +1 -1
- package/dist/lib/state/persistence.d.ts +2 -0
- package/dist/lib/state/persistence.d.ts.map +1 -1
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/types.d.ts +10 -0
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/state/utils.d.ts.map +1 -1
- package/dist/lib/ui/notification.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -422,6 +422,32 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
422
422
|
|
|
423
423
|
## Changelog
|
|
424
424
|
|
|
425
|
+
### v1.12.1 — Compression Recap Injection Fix + Stale Compress Stripping (PR #119)
|
|
426
|
+
|
|
427
|
+
**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.
|
|
428
|
+
|
|
429
|
+
**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.
|
|
430
|
+
|
|
431
|
+
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.
|
|
432
|
+
|
|
433
|
+
### v1.12.0 — Baseline Leak Fix + KEEP/REF Markers + Compressible Ranges (PR #115)
|
|
434
|
+
|
|
435
|
+
Comprehensive fix for issue #23 (context memory leak). 7 commits, 22 files, 851 insertions, 327 deletions.
|
|
436
|
+
|
|
437
|
+
**Baseline Leak Fix**: After compress, the model continues working in the same turn, inflating context from ~78K to ~150K. Each transform re-established the nudge baseline to the inflated value, leaking 72K of headroom. Fix: `compressBaselineSet` lock flag sets baseline only on the first post-compress transform; turn-wide compress scan (`messages.slice(currentTurnStart).some(...)`) replaces last-message-only check.
|
|
438
|
+
|
|
439
|
+
**KEEP/REF Markers**: Models over-summarize because they can't precisely retype large content. `[[KEEP:mNNNNN]]` auto-expands original message content inline (truncated to 2000 chars). `[[REF:mNNNNN|desc]]` creates compact links. Resolution runs after summary finalization, before wrapping.
|
|
440
|
+
|
|
441
|
+
**Compressible Ranges**: Replaces size-based "Largest code/text messages" listing with need-based ranges grouped by conversation turn. Shows ALL ranges with gap detection (no ranges spanning compressed holes). The nudge now says "compress ALL listed ranges" instead of recommending specific large items.
|
|
442
|
+
|
|
443
|
+
**Compression Philosophy (5 bullets)**: Need-based guidance replacing size-based recommendations — compress by need not by percentage, work from summaries not raw outputs, curate with KEEP/REF for critical content.
|
|
444
|
+
|
|
445
|
+
**Other fixes**: Removed `toolOutputReminder` (bypassed adaptive threshold, caused over-compression); `acp_status` default = compressible ranges view; debug nudge (`config.debug` → terminal output); `baselineCorrected` persistence fix; Bug 14 cap (detailed notification: 10K chars); system prompt 5 fixes; multi-block notification empty summary fix. Oracle reviewed.
|
|
446
|
+
|
|
447
|
+
Files: `lib/messages/inject/inject.ts`, `lib/compress/keep-markers.ts`, `lib/messages/inject/utils.ts`, `lib/compress/status.ts`, `lib/prompts/compression-rules.ts`, `lib/prompts/system.ts`, `lib/state/`, `lib/ui/notification.ts`, `lib/hooks.ts`. Tests: 630 pass.
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
425
451
|
### v1.11.4 — Baseline Persistence Fix + Unified Release Workflow (PR #112, #113)
|
|
426
452
|
|
|
427
453
|
**Bug fix (PR #112)**: After compress sets `lastPerMessageNudgeTokens = undefined`, the next transform re-establishes the baseline in memory but never persists it to disk (save condition was false). After restart, nudges break again. Fix: added `baselineReEstablished` flag to save condition. Also fixed async save race condition in `writePersistedSessionState` (file path resolved after `await`).
|
package/README.zh-CN.md
CHANGED
|
@@ -395,6 +395,32 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
|
|
|
395
395
|
|
|
396
396
|
## 更新日志
|
|
397
397
|
|
|
398
|
+
### v1.12.1 — 压缩摘要注入修复 + 历史压缩调用剥离(PR #119)
|
|
399
|
+
|
|
400
|
+
**问题**:`acp_context_recap` 用于创建合成的 tool-result 摘要消息,但未注册为真实工具——provider 可能剥离/转换未注册的 tool-result,导致模型将压缩摘要视为纯文本或用户消息(回声/漂移 bug)。此外,compress 工具调用的输入与 block recap 内容重复占用上下文。
|
|
401
|
+
|
|
402
|
+
**修复**:将 `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` 功能。
|
|
403
|
+
|
|
404
|
+
文件:`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 审查。
|
|
405
|
+
|
|
406
|
+
### v1.12.0 — 基线泄露修复 + KEEP/REF 标记 + 可压缩范围(PR #115)
|
|
407
|
+
|
|
408
|
+
Issue #23(上下文内存泄露)的综合修复。7 个 commit,22 个文件,851 行新增,327 行删除。
|
|
409
|
+
|
|
410
|
+
**基线泄露修复**:压缩后模型在同一轮继续工作,上下文从 ~78K 膨胀到 ~150K。每次 transform 重新建立 nudge 基线到膨胀后的值,泄露 72K 余量。修复:`compressBaselineSet` 锁标志只在首次 post-compress transform 设基线;全轮扫描(`messages.slice(currentTurnStart).some(...)`)替换仅检查最后一条 assistant 消息。
|
|
411
|
+
|
|
412
|
+
**KEEP/REF 标记**:模型过度摘要因为无法精确重打大段内容。`[[KEEP:mNNNNN]]` 自动展开原始消息内容(截断到 2000 字符)。`[[REF:mNNNNN|描述]]` 生成紧凑链接。解析在摘要定稿后、包装前执行。
|
|
413
|
+
|
|
414
|
+
**可压缩范围**:用按需分组范围替换基于大小的"最大代码/文本消息"列表。显示所有范围,带间隔检测(不会跨越压缩洞)。nudge 现在说"压缩所有列出的范围"而不是推荐特定大项。
|
|
415
|
+
|
|
416
|
+
**压缩哲学(5 条)**:基于需要的指导替换基于大小的推荐——按需压缩而非按百分比,基于摘要工作而非原始输出,用 KEEP/REF 策展关键内容。
|
|
417
|
+
|
|
418
|
+
**其他修复**:移除 `toolOutputReminder`(绕过自适应阈值,导致过度压缩);`acp_status` 默认 = 可压缩范围视图;调试 nudge(`config.debug` → 终端输出);`baselineCorrected` 持久化修复;Bug 14 截断(detailed 通知:10K 字符);系统提示 5 处修复;多块通知空摘要修复。经 Oracle 审查。
|
|
419
|
+
|
|
420
|
+
文件:`lib/messages/inject/inject.ts`、`lib/compress/keep-markers.ts`、`lib/messages/inject/utils.ts`、`lib/compress/status.ts`、`lib/prompts/compression-rules.ts`、`lib/prompts/system.ts`、`lib/state/`、`lib/ui/notification.ts`、`lib/hooks.ts`。测试:630 通过。
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
398
424
|
### v1.11.4 — 基线持久化修复 + 统一发布工作流(PR #112, #113)
|
|
399
425
|
|
|
400
426
|
**Bug 修复(PR #112)**:压缩后 baseline 设为 `undefined`,下一轮重建为真实值但**不写盘**(save 条件为 false)。重启后 nudge 失效。修复:新增 `baselineReEstablished` flag 加入 save 条件。同时修复 `writePersistedSessionState` 异步竞态(文件路径在 `await` 之后解析)。
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,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"}
|