opencode-acp 1.12.2 → 1.12.4
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 +16 -0
- package/README.zh-CN.md +16 -0
- package/dist/index.js +348 -75
- package/dist/index.js.map +1 -1
- 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 +3 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/messages/inject/inject.d.ts.map +1 -1
- package/dist/lib/messages/inject/utils.d.ts +15 -3
- package/dist/lib/messages/inject/utils.d.ts.map +1 -1
- package/package.json +1 -1
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.4 — Protection-Aware Stats + Nudge Ranges Fix + Growth Floor Gate (PRs #132, #133, #134)
|
|
426
|
+
|
|
427
|
+
**Problem**: Three issues since v1.12.3. (1) `buildCompressibleRanges` and `estimateContextComposition` listed ALL messages as compressible, silently including protected tool output — the model saw inflated ranges, compressed, and most content was filtered out → ineffective compression with confusing stats. (2) When nudge anchors were active (context over minLimit) but growth was below the cadence threshold, the nudge text fired but the compressible ranges list was gated by growth cadence → model saw "compress now" with no ranges. (3) After fixing #2, the model could be nudged every turn (turn anchors re-add every turn) → thrashing risk.
|
|
428
|
+
|
|
429
|
+
**Fix**: (1) PR #132: `buildCompressibleRanges`, `estimateContextComposition`, and `acp_status` now skip protected tools/files. Per-range protected detail with mixed compressible+protected display. (2) PR #134: Broadened nudge output to fire when anchors active regardless of growth cadence. (3) PR #134: Added growth floor gate — nudges suppressed unless context grew by `max(minNudgeGrowthFloor, minNudgeGrowthRatio × nudgeGrowthTokens)` tokens since last nudge, with emergency override at `emergencyThresholdPercent` (98%). Also raised `minCompressRange` default 2000→5000. PR #133: `getCurrentTokenUsage` accepts input-only token data (output=0 fix). Oracle-reviewed.
|
|
430
|
+
|
|
431
|
+
Files: `lib/messages/inject/inject.ts`, `lib/messages/inject/utils.ts`, `lib/compress/status.ts`, `lib/config.ts`, `lib/config-validation.ts`, `lib/token-utils.ts`, `dcp.schema.json`. Tests: `tests/inject.test.ts`, `tests/config-validation.test.ts`, `tests/protection-aware-stats.test.ts`, `tests/token-counting.test.ts`. 688 tests pass.
|
|
432
|
+
|
|
433
|
+
### v1.12.3 — Regex Tag Fragment Leak Fix (PR #130)
|
|
434
|
+
|
|
435
|
+
**Problem**: Three regexes in `lib/messages/utils.ts` had missing opening-tag `<` and tag-name matchers, causing ACP internal XML tag fragments and stale message IDs to leak into user-visible chat after multiple compression rounds (issue #123).
|
|
436
|
+
|
|
437
|
+
**Fix**: (1) `DCP_PAIRED_TAG_REGEX` (line 14): `]*>` matched any `>` char → fixed to `<(?:dcp|acp)[^>]*>`. (2) `DCP_BLOCK_ID_TAG_REGEX` (line 11): `(])` required literal `]` → `replaceBlockIdsWithBlocked` was a complete no-op → fixed to `(<(?:dcp|acp)-message-id[^>]*>)`. (3) `DCP_MESSAGE_REF_TAG_REGEX` (line 13): matched only `m\d+</closing>` → left `<dcp-message-id ...>` opening tag fragments → fixed to include opening tag. Supersedes PR #124.
|
|
438
|
+
|
|
439
|
+
Files: `lib/messages/utils.ts`. Tests: `tests/regex-tag-leak.test.ts` (NEW, 23 tests). 666 tests pass.
|
|
440
|
+
|
|
425
441
|
### v1.12.2 — Compress Failure Rollback + Sync Carve-out Removal (PR #126)
|
|
426
442
|
|
|
427
443
|
**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.
|
package/README.zh-CN.md
CHANGED
|
@@ -395,6 +395,22 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
|
|
|
395
395
|
|
|
396
396
|
## 更新日志
|
|
397
397
|
|
|
398
|
+
### v1.12.4 — 保护感知统计 + Nudge 范围修复 + 增长下限门控(PR #132, #133, #134)
|
|
399
|
+
|
|
400
|
+
**问题**:v1.12.3 以来三个问题。(1)`buildCompressibleRanges` 和 `estimateContextComposition` 将所有消息列为可压缩,静默包含受保护工具输出 → 模型看到虚高的范围,压缩后大部分被过滤 → 无效压缩和混乱统计。(2)当 nudge anchors 激活(context 超过 minLimit)但增长低于节奏阈值时,nudge 文本触发但可压缩范围列表被增长节奏门控 → 模型看到"立即压缩"但没有范围。(3)修复 #2 后,模型可能每轮被 nudge(turn anchors 每轮重新添加)→ thrashing 风险。
|
|
401
|
+
|
|
402
|
+
**修复**:(1)PR #132:`buildCompressibleRanges`、`estimateContextComposition`、`acp_status` 现在跳过受保护工具/文件。逐范围保护详情,混合可压缩+受保护显示。(2)PR #134:放宽 nudge 输出,当 anchors 激活时无论增长节奏都触发。(3)PR #134:新增增长下限门控 — 除非 context 自上次 nudge 增长了 `max(minNudgeGrowthFloor, minNudgeGrowthRatio × nudgeGrowthTokens)` tokens,否则 nudge 被抑制,紧急覆盖在 `emergencyThresholdPercent`(98%)。同时将 `minCompressRange` 默认值 2000→5000。PR #133:`getCurrentTokenUsage` 接受仅输入 token 数据(output=0 修复)。Oracle 审查通过。
|
|
403
|
+
|
|
404
|
+
文件:`lib/messages/inject/inject.ts`、`lib/messages/inject/utils.ts`、`lib/compress/status.ts`、`lib/config.ts`、`lib/config-validation.ts`、`lib/token-utils.ts`、`dcp.schema.json`。测试:`tests/inject.test.ts`、`tests/config-validation.test.ts`、`tests/protection-aware-stats.test.ts`、`tests/token-counting.test.ts`。688 个测试通过。
|
|
405
|
+
|
|
406
|
+
### v1.12.3 — 正则标签碎片泄漏修复(PR #130)
|
|
407
|
+
|
|
408
|
+
**问题**:`lib/messages/utils.ts` 中三个正则表达式缺少开标签 `<` 和标签名匹配,导致 ACP 内部 XML 标签碎片和过期消息 ID 在多轮压缩后泄漏到用户可见的对话框中(issue #123)。
|
|
409
|
+
|
|
410
|
+
**修复**:(1)`DCP_PAIRED_TAG_REGEX`(第 14 行):`]*>` 匹配任意 `>` 字符 → 修正为 `<(?:dcp|acp)[^>]*>`。(2)`DCP_BLOCK_ID_TAG_REGEX`(第 11 行):`(])` 要求字面量 `]` → `replaceBlockIdsWithBlocked` 完全失效 → 修正为 `(<(?:dcp|acp)-message-id[^>]*>)`。(3)`DCP_MESSAGE_REF_TAG_REGEX`(第 13 行):只匹配 `m\d+</closing>` → 残留 `<dcp-message-id ...>` 开标签碎片 → 补上开标签匹配。取代 PR #124。
|
|
411
|
+
|
|
412
|
+
文件:`lib/messages/utils.ts`。测试:`tests/regex-tag-leak.test.ts`(新增,23 个测试)。666 个测试通过。
|
|
413
|
+
|
|
398
414
|
### v1.12.2 — 压缩失败回滚 + Sync carve-out 移除(PR #126)
|
|
399
415
|
|
|
400
416
|
**问题**:压缩失败后的处理存在两个 bug(issue #125)。(1)compress 工具在内存中增量修改状态,没有 try/catch——如果在 `applyCompressionState` 和 `finalizeSession` 之间抛出异常,"幽灵块"(未持久化的活跃块)会在后续 transform 中隐藏消息。(2)`syncCompressionBlocks` 有一个 carve-out:当块的锚点从消息中缺失但在 `byMessageId` 中有记录时,块保持活跃。这个 carve-out 本意是保护 ACP 隐藏的锚点,但 sync 运行在原始消息列表上(在过滤之前),所以它只在外部删除的锚点场景触发 → 块保持活跃但无法注入摘要 → 隐藏消息无替换 → **LLM 请求为空**。
|