opencode-acp 1.5.1 → 1.6.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 CHANGED
@@ -82,18 +82,20 @@ Or add to your opencode config:
82
82
 
83
83
  ACP hands the context-compression tool directly to the model. The model is
84
84
  **100% responsible** for context compression. The model's available tools are
85
- mainly: **compress**, **decompress**, and **delete** (`mark_block` / `unmark_block`).
85
+ mainly: **compress** and **decompress**. A hardcoded 100% GC fallback acts as
86
+ a safety net when the context window is completely full.
86
87
 
87
88
  ### Lifecycle
88
89
 
89
- Three operations: **compress**, **decompress**, and **delete**. Content loops
90
- between raw and compressed, and eventually terminates in deletion:
90
+ Two operations: **compress** and **decompress**. Content loops between raw and
91
+ compressed. When context hits 100%, old-gen block summaries are truncated as
92
+ a last resort:
91
93
 
92
94
  ```mermaid
93
95
  stateDiagram-v2
94
96
  Raw --> Compressed : compress
95
97
  Compressed --> Raw : decompress
96
- Compressed --> Deleted : delete
98
+ Compressed --> Truncated : GC at 100%
97
99
  ```
98
100
 
99
101
  ### Compression strategy
@@ -305,7 +307,7 @@ Each level overrides the previous, so project settings take priority over global
305
307
  "protectedTools": [],
306
308
  },
307
309
  },
308
- // Garbage collection and batch cleanup
310
+ // Garbage collection hardcoded 100% fallback only
309
311
  "gc": {
310
312
  "algorithm": "truncate",
311
313
  // young → old generation promotion after this many survivals
@@ -314,18 +316,8 @@ Each level overrides the previous, so project settings take priority over global
314
316
  "maxBlockAge": 15,
315
317
  // truncate old-gen summaries exceeding this length (chars)
316
318
  "maxOldGenSummaryLength": 3000,
317
- // run major GC when context usage exceeds this
319
+ // run major GC when context usage exceeds this (hardcoded, not configurable)
318
320
  "majorGcThresholdPercent": "100%",
319
- // Three-tier batch merge-cleanup for blocks flagged via mark_block.
320
- // Accepts a number or "X%" of the model context window.
321
- "batchCleanup": {
322
- // At/above this usage, remind the model about marked blocks
323
- "lowThreshold": "60%",
324
- // At/above this usage, auto merge-compress all marked blocks into one
325
- "highThreshold": "75%",
326
- // At/above this usage, force-merge all old-gen blocks (before GC)
327
- "forceThreshold": "90%",
328
- },
329
321
  },
330
322
  }
331
323
  ```
@@ -354,7 +346,7 @@ To reset an override, delete the matching file from your overrides directory.
354
346
  ### Protected Tools
355
347
 
356
348
  By default, these tools are always protected from pruning:
357
- `task`, `skill`, `todowrite`, `todoread`, `compress`, `decompress`, `mark_block`, `unmark_block`, `batch`, `plan_enter`, `plan_exit`, `write`, `edit`
349
+ `task`, `skill`, `todowrite`, `todoread`, `compress`, `decompress`, `batch`, `plan_enter`, `plan_exit`, `write`, `edit`
358
350
 
359
351
  The `protectedTools` arrays in `commands` and `strategies` add to this default list.
360
352
 
package/README.zh-CN.md CHANGED
@@ -73,17 +73,17 @@ opencode plugin opencode-acp@latest --global
73
73
 
74
74
  ## 工作原理
75
75
 
76
- ACP 把上下文压缩工具直接交给模型。模型对上下文压缩**负全责**。模型可用的工具主要是:**compress**、**decompress** 和 **delete**(`mark_block` / `unmark_block`)。
76
+ ACP 把上下文压缩工具直接交给模型。模型对上下文压缩**负全责**。模型可用的工具主要是:**compress** 和 **decompress**。当上下文达到 100% 时,系统自动触发 GC 截断作为兜底。
77
77
 
78
78
  ### 生命周期
79
79
 
80
- 三个操作:**压缩**、**解压缩**、**删除**。内容在原始与压缩之间循环,最终以删除终结:
80
+ 两个操作:**压缩**、**解压缩**。内容在原始与压缩之间循环。当上下文达到 100% 时,GC 自动截断老年代 block 作为兜底:
81
81
 
82
82
  ```mermaid
83
83
  stateDiagram-v2
84
84
  Raw --> Compressed : compress
85
85
  Compressed --> Raw : decompress
86
- Compressed --> Deleted : delete
86
+ Compressed --> GC_Truncated : GC (100%)
87
87
  ```
88
88
 
89
89
  ### 压缩策略
@@ -104,9 +104,9 @@ stateDiagram-v2
104
104
 
105
105
  由模型决定何时解压。当上下文大到足以干扰模型的 self-attention 时,简短的 block 会让模型先压缩一部分内容,处理完紧急事务,再在后续工作中按需解压。
106
106
 
107
- ### 删除策略
107
+ ### GC 兜底
108
108
 
109
- 为了应对大量小块历史内容的堆积,新版本增加了删除策略。由模型决定是否删除。**一旦删除,内容不可恢复。** 这取代了原先的强制 GC,使得强制垃圾回收不再删除模型认为重要的内容。
109
+ 当上下文达到 100% 时,系统自动截断老年代 block 摘要,防止上下文溢出。这是最后的兜底机制,不影响模型的正常压缩/解压操作。
110
110
 
111
111
  ---
112
112
 
@@ -289,18 +289,8 @@ ACP 使用自己的配置文件,按以下顺序搜索:
289
289
  "maxBlockAge": 15,
290
290
  // 截断超过此长度(字符)的老年代摘要
291
291
  "maxOldGenSummaryLength": 3000,
292
- // 上下文使用率超过此值时执行主 GC
292
+ // 上下文使用率超过此值时执行主 GC(兜底,硬编码为 100%)
293
293
  "majorGcThresholdPercent": "100%",
294
- // 通过 mark_block 标记的块的三级批量合并清理阈值。
295
- // 接受数字或 "X%"(模型上下文窗口的百分比)。
296
- "batchCleanup": {
297
- // 达到此使用率时,提醒模型已标记的块
298
- "lowThreshold": "60%",
299
- // 达到此使用率时,自动将所有已标记块合并压缩为一个
300
- "highThreshold": "75%",
301
- // 达到此使用率时,强制合并所有老年代块(GC 之前)
302
- "forceThreshold": "90%",
303
- },
304
294
  },
305
295
  }
306
296
  ```
@@ -329,7 +319,7 @@ ACP 暴露六个可编辑的 prompt:
329
319
  ### 受保护工具
330
320
 
331
321
  默认情况下,以下工具始终受保护不被剪枝:
332
- `task`、`skill`、`todowrite`、`todoread`、`compress`、`decompress`、`mark_block`、`unmark_block`、`batch`、`plan_enter`、`plan_exit`、`write`、`edit`
322
+ `task`、`skill`、`todowrite`、`todoread`、`compress`、`decompress`、`batch`、`plan_enter`、`plan_exit`、`write`、`edit`
333
323
 
334
324
  `commands` 和 `strategies` 中的 `protectedTools` 数组会添加到此默认列表。
335
325
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA2BjD,QAAA,MAAM,MAAM,EAAE,MAoHK,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;AAyBjD,QAAA,MAAM,MAAM,EAAE,MAkHK,CAAA;AAEnB,eAAe,MAAM,CAAA"}