opencode-acp 1.12.4 → 1.12.5
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,14 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
422
422
|
|
|
423
423
|
## Changelog
|
|
424
424
|
|
|
425
|
+
### v1.12.5 — Bug 20 Suppression Fix + Growth Floor Gate Correction (PRs #139, #140)
|
|
426
|
+
|
|
427
|
+
**Problem**: Two bugs in the nudge suppression logic introduced after v1.12.4. (1) `isContextOverLimits` Bug 20 suppression checked `(part as any).type === "tool-invocation" && (part as any).toolInvocation?.toolName === "compress"` — a message-part format that does not exist in the SDK (all 18+ other tool-type checks in the codebase use `part.type === "tool" && part.tool === "compress"`). The suppression never matched, so `overMaxLimit` was never set to `false` after a compress call → the max-limit alert fired every turn → over-compression feedback loop. (2) The growth floor gate (PR #134) made `growthFloor` the sole gate for `nudgeAllowed`, dropping the `decision.shouldNudge` requirement — meaning nudges could fire on negative growth as long as the growth floor condition was met.
|
|
428
|
+
|
|
429
|
+
**Fix**: (1) PR #139: Changed the format check to `part.type === "tool" && part.tool === "compress"` and removed the `(part as any)` casts. Suppression now correctly detects compress tool calls in recent messages and resets `overMaxLimit`. (2) PR #140: `nudgeAllowed` now requires `decision.shouldNudge || emergencyOverride`, restoring the intended two-condition gate.
|
|
430
|
+
|
|
431
|
+
Files: `lib/messages/inject/utils.ts` (Bug 20 fix), `lib/messages/inject/inject.ts` (growth floor correction). 688 tests pass.
|
|
432
|
+
|
|
425
433
|
### v1.12.4 — Protection-Aware Stats + Nudge Ranges Fix + Growth Floor Gate (PRs #132, #133, #134)
|
|
426
434
|
|
|
427
435
|
**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.
|
package/README.zh-CN.md
CHANGED
|
@@ -395,6 +395,14 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
|
|
|
395
395
|
|
|
396
396
|
## 更新日志
|
|
397
397
|
|
|
398
|
+
### v1.12.5 — Bug 20 抑制修复 + 增长下限门控修正(PR #139, #140)
|
|
399
|
+
|
|
400
|
+
**问题**:v1.12.4 后引入的两个 nudge 抑制逻辑 bug。(1)`isContextOverLimits` 的 Bug 20 抑制检查 `(part as any).type === "tool-invocation" && (part as any).toolInvocation?.toolName === "compress"` —— 这个消息部件格式在 SDK 中根本不存在(代码库中其他 18+ 处工具类型检查全部使用 `part.type === "tool" && part.tool === "compress"`)。抑制逻辑永不匹配,所以压缩后 `overMaxLimit` 从不置 false → max-limit 告警每轮触发 → 过度压缩正反馈循环。(2)增长下限门控(PR #134)使 `growthFloor` 成为 `nudgeAllowed` 的唯一 gate,丢弃了 `decision.shouldNudge` 要求 —— 意味着即使增长为负,只要满足增长下限条件 nudge 就会触发。
|
|
401
|
+
|
|
402
|
+
**修复**:(1)PR #139:将格式检查改为 `part.type === "tool" && part.tool === "compress"`,移除了 `(part as any)` 类型断言。抑制现在正确检测最近消息中的 compress 工具调用并重置 `overMaxLimit`。(2)PR #140:`nudgeAllowed` 现在要求 `decision.shouldNudge || emergencyOverride`,恢复预期的双条件门控。
|
|
403
|
+
|
|
404
|
+
文件:`lib/messages/inject/utils.ts`(Bug 20 修复)、`lib/messages/inject/inject.ts`(增长下限修正)。688 测试通过。
|
|
405
|
+
|
|
398
406
|
### v1.12.4 — 保护感知统计 + Nudge 范围修复 + 增长下限门控(PR #132, #133, #134)
|
|
399
407
|
|
|
400
408
|
**问题**:v1.12.3 以来三个问题。(1)`buildCompressibleRanges` 和 `estimateContextComposition` 将所有消息列为可压缩,静默包含受保护工具输出 → 模型看到虚高的范围,压缩后大部分被过滤 → 无效压缩和混乱统计。(2)当 nudge anchors 激活(context 超过 minLimit)但增长低于节奏阈值时,nudge 文本触发但可压缩范围列表被增长节奏门控 → 模型看到"立即压缩"但没有范围。(3)修复 #2 后,模型可能每轮被 nudge(turn anchors 每轮重新添加)→ thrashing 风险。
|
package/dist/index.js
CHANGED
|
@@ -6497,7 +6497,7 @@ function isContextOverLimits(config, state, providerId, modelId, messages) {
|
|
|
6497
6497
|
for (const msg of recentMessages) {
|
|
6498
6498
|
if (msg.info.role === "assistant" && msg.parts) {
|
|
6499
6499
|
for (const part of msg.parts) {
|
|
6500
|
-
if (part.type === "tool
|
|
6500
|
+
if (part.type === "tool" && part.tool === "compress") {
|
|
6501
6501
|
overMaxLimit = false;
|
|
6502
6502
|
break;
|
|
6503
6503
|
}
|
|
@@ -7220,7 +7220,7 @@ var injectCompressNudges = (state, config, logger, messages, prompts, compressio
|
|
|
7220
7220
|
nudgeGrowthTokens: effectiveThreshold
|
|
7221
7221
|
});
|
|
7222
7222
|
const growthSinceBaseline = currentTokens !== void 0 && growthReference !== void 0 ? currentTokens - growthReference : void 0;
|
|
7223
|
-
const nudgeAllowed = emergencyOverride || growthSinceBaseline !== void 0 && growthSinceBaseline >= growthFloor;
|
|
7223
|
+
const nudgeAllowed = emergencyOverride || decision.shouldNudge && growthSinceBaseline !== void 0 && growthSinceBaseline >= growthFloor;
|
|
7224
7224
|
state.nudges.shouldInjectThisTurn = nudgeAllowed;
|
|
7225
7225
|
const effectiveTipsVariant = emergencyOverride ? "maxLimit" : decision.tipsVariant;
|
|
7226
7226
|
if (nudgeAllowed) {
|