From 8f676c7bf58df87263d43d72cbf2cdf0b0116e51 Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Fri, 21 Aug 2026 21:24:45 +0800 Subject: [PATCH] =?UTF-8?q?release:=20v1.14.23=20=E2=80=94=20fix=20batch?= =?UTF-8?q?=20(#325=20#326=20#327=20#328)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 16 ++++++++++ CHANGELOG.zh-CN.md | 16 ++++++++++ devlog/2026-08-21_release-v1.14.23/REQ.md | 30 +++++++++++++++++++ devlog/2026-08-21_release-v1.14.23/WORKLOG.md | 26 ++++++++++++++++ package-lock.json | 4 +-- package.json | 2 +- 6 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 devlog/2026-08-21_release-v1.14.23/REQ.md create mode 100644 devlog/2026-08-21_release-v1.14.23/WORKLOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index eff08ed..1b826cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +### v1.14.23 — Fix batch: effective compressible accounting, emergency no-target notice, fixed growth threshold, tag-aware auto-update + +**Problem**: Four fix clusters since v1.14.22: (1) nudge accounting counted messages the compression pipeline soft-filters (protected anchors, empty messages, last user message) as "compressible", so the model was pointed at phantom ranges and every failed retry re-armed the same nudge — the repeated-compression loop of issue #37 (floors 156-175, ~10 phantom retries); (2) under emergency override with nothing valid to compress, ACP still demanded "compress now" every turn (~12 failed compressions; #216 residual surviving the v1.14.4 fix through the emergency path); (3) `nudgeGrowthTokens` defaulted adaptively to `min(50K, max(6K, modelContextLimit×5%))`, so nudge cadence silently scaled 5× between a 262K and a 1M model with identical configs — and since v1.14.15 users with any compress key got the adaptive value while users with none got fixed 50K; (4) auto-update never fired for `opencode-acp@stable` installs (bare dist-tag words failed the updatable-spec gate) and compared against the hardcoded `latest` dist-tag, which can never land for a tagged install (#328). + +**Fix**: +- **#325** `CompressibleRange.effectiveTokens` counts only messages that survive pipeline soft-filters; `resolveEffectiveFloor` derives the floor from `minCompressRange÷4` (0 when `minCompressRange: 0`); universal `effective > 0` guard stops phantom-range recommendations; `nothingToCompress` extended with `allBelowMin`. Fixes the phantom retry loop of issue #37. +- **#326** emergency + no valid targets now emits a single actionable `/compact` notice (via reply tool) instead of demanding compressions that cannot succeed — closes the #216 residual. +- **#327** `nudgeGrowthTokens` is a fixed `50000` default for all models (T2/T3 tier triggers and growthFloor uniform at 22.5K); `compress.nudgeGrowthTokens` remains the single tuning knob. +- **#330** auto-update tracks the dist-tag the plugin was installed from (`@stable` follows `stable`, `@pr-N` follows `pr-N`, ranges follow `latest`); registry version check hits `/name/ 0` 守卫阻止幻影区间推荐;`nothingToCompress` 扩展 `allBelowMin`。修复 issue #37 的幻影重试循环。 +- **#326** 紧急 + 无有效目标时改发一条可执行的 `/compact` 通知(经 reply 工具),不再要求不可能成功的压缩 —— 关闭 #216 残留。 +- **#327** `nudgeGrowthTokens` 对所有模型固定默认 `50000`(T2/T3 层触发与 growthFloor 统一为 22.5K);`compress.nudgeGrowthTokens` 仍是唯一调节旋钮。 +- **#330** 自动更新跟踪安装时所用 dist-tag(`@stable` 跟随 `stable`,`@pr-N` 跟随 `pr-N`,范围规范跟随 `latest`);registry 版本检查改查 `/name/`;版本锁定与非 registry 规范永不更新。关闭 #328。 + +文件:`lib/messages/inject/inject.ts`、`lib/messages/inject/utils.ts`、`lib/update.ts`、`dcp.schema.json`、文档(README×2、CONFIGURATION×2)。测试:1024 通过 / 0 失败;E2E 场景在钉住场景配置后全部通过。 + +关闭:#328(同时解决 #37/#216 的幻影循环与紧急命令症状)。 + +**安装**:`opencode plugin opencode-acp@latest --global` + ### v1.14.22 — 稳定的 system prompt token 估计 (#255) **问题**:ACP 压缩把真正的首条 assistant 消息从可见历史中物理剪掉后,nudge 和 `acp_status` 各自从"第一个可见 assistant"(实际是后轮次,其 `input` 含大量累积历史)重新推导 system prompt token 估计。两者都会把估计值吹大(真实 ~10K 的 system 被报成 ~200K),且因各用各的消息视图(剪枝后的 transform 数组 vs 重新拉取的 store),两个数字还会互相不一致。`state.systemPromptTokens` 缓存(每轮在剪枝前写入)一直存在,但从未被读取。 diff --git a/devlog/2026-08-21_release-v1.14.23/REQ.md b/devlog/2026-08-21_release-v1.14.23/REQ.md new file mode 100644 index 0000000..e0bf8e8 --- /dev/null +++ b/devlog/2026-08-21_release-v1.14.23/REQ.md @@ -0,0 +1,30 @@ +# REQ — v1.14.23: fix batch (#325, #326, #327, #328) + +## Problem + +Patch release shipping four fix clusters accumulated on master since v1.14.22: + +1. **#325** (issue #37 phantom loop): nudge accounting counted pipeline-soft-filtered messages + as compressible → phantom-range recommendations → ~10 failed retries re-arming the same nudge. +2. **#326** (#216 residual): emergency override + `nothingToCompress` still demanded "compress + now" every turn (~12 failed compressions in incident `ses_7fb5cbc8`). +3. **#327**: `nudgeGrowthTokens` adaptive default (`window×5%`) scaled nudge cadence 5× between + 262K/1M models with identical config; config-default vs policy-default divergence since + v1.14.15. +4. **#328**: auto-update never fired for `@stable` installs (dist-tag gate) and compared against + hardcoded `latest` — unlandable for tagged installs. + +## Content since v1.14.22 + +- `a6921bd` Merge PR #325 — `fix: effective compressible accounting stops phantom-range retry loops` +- `e9a6b08` Merge PR #326 — `fix: emergency + nothing-to-compress emits /compact notice (#216 residual)` +- `c2c863b` Merge PR #327 — `fix: nudgeGrowthTokens fixed default 50K — removes window-percentage scaling` +- `971d9b7` Merge PR #330 — `fix: auto-update tracks installed dist-tag, not hardcoded latest (#328)` + +## Acceptance + +- All existing tests pass (1024 expected) +- Version bump on this release branch only; `CHANGELOG.md` and `CHANGELOG.zh-CN.md` updated + with `### v1.14.23` +- typecheck green +- release.yml publishes v1.14.23 to npm `latest` after merge diff --git a/devlog/2026-08-21_release-v1.14.23/WORKLOG.md b/devlog/2026-08-21_release-v1.14.23/WORKLOG.md new file mode 100644 index 0000000..f51339c --- /dev/null +++ b/devlog/2026-08-21_release-v1.14.23/WORKLOG.md @@ -0,0 +1,26 @@ +# WORKLOG — v1.14.23 + +## Commits on this release (since v1.14.22) + +1. `a6921bd` Merge PR #325 — effective compressible accounting: + `CompressibleRange.effectiveTokens` (soft-filter survivors only), `resolveEffectiveFloor` + (`minCompressRange÷4`, 0 when disabled), universal `effective > 0` guard, `nothingToCompress.allBelowMin` +2. `e9a6b08` Merge PR #326 — emergency no-target path emits actionable `/compact` notice + (reply tool) instead of compress demands; stacked on #325 +3. `c2c863b` Merge PR #327 — `nudgeGrowthTokens` fixed default 50K (uniform growthFloor 22.5K); + E2E scenario configs pinned; stale adaptive docs dropped +4. `971d9b7` Merge PR #330 — auto-update by installed dist-tag: `specUpdateTag`, `updateTarget`, + `isDistTag`, `/name/` registry check (fixes #328); +6 fail-first tests; docs ×4 + +## Release steps + +- `npm version 1.14.23 --no-git-tag-version` (bump `package.json` + `package-lock.json`) +- `### v1.14.23` entries added to `CHANGELOG.md` and `CHANGELOG.zh-CN.md` +- Devlog: this folder (REQ.md + WORKLOG.md) +- Commit `release: v1.14.23 — fix batch (#325 #326 #327 #328)` + +## Verification + +- `npx tsc --noEmit` — green +- `node --import tsx --test tests/*.test.ts` — 1024 pass, 0 fail +- release.yml publishes v1.14.23 to npm `latest` after merge (tag v1.14.23 + GitHub Release) diff --git a/package-lock.json b/package-lock.json index 5c83d62..ec80642 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencode-acp", - "version": "1.14.22", + "version": "1.14.23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencode-acp", - "version": "1.14.22", + "version": "1.14.23", "license": "AGPL-3.0-or-later", "dependencies": { "@anthropic-ai/tokenizer": "^0.0.4", diff --git a/package.json b/package.json index e468828..3b57285 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "opencode-acp", - "version": "1.14.22", + "version": "1.14.23", "type": "module", "description": "Active Context Pruning — model-driven context management for OpenCode (hardened fork of DCP with 35 bug fixes)", "main": "./dist/index.js",