Repository navigation
feat: neverPreserveRecentTools config knob (acp-kernel 0.0.92) - #1332
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1332Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1332.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Config plumbing (parse/validate/merge/resolve) for kernel neverPreserveRecentTools (#395): tool patterns excluded from the soft-protected recent zone. Recommended remedy for the #1198/#1277 batch-read fold->re-read death loop: remove only 'read' from the kernel default list. Empty array is a valid max-protection escape hatch, unlike protectedTools/protectedLatestTools. Refs #1277
…n); disambiguate zh README recent-zone clause (#1332 review)
7a7a694 to
9e1a889
Compare
[bot] 🏷 PR #1332 reviewed — 可合并( ① 原 issue 方向(过):#1277 是 owner 拍板的功能 —— 把内核硬编码的 ② 回归面(清):逐项清点 —— key 未设置时路径与改动前完全一致( ③ 代码(过): ④ 测试有效性(过): ⑤ diff 整洁度(过):9 个文件全部 on-purpose,无空行/重排噪音,lockfile 仅 pin 行。 门禁证据(rebase 后 head = 当前 master 994ec6c + 本 PR): 已在 PR 分支直接补的小修(标注 commit
观察项(不在本 PR 内改): 中文摘要:本 PR 把内核硬编码的 neverPreserveRecentTools 暴露为 compress 配置项(方向与 #1277 owner 决策一致、未设定时行为逐字节不变、带真实内核 e2e 的回归测试),review 中直接修掉 Web UI i18n 漏列新键和中文 README 一处语义反转,rebase 到最新 master 后全套门禁通过——可以合并。 |
…t-zone exclusion list The positive-facing counterpart of neverPreserveRecentTools: patterns REMOVED from the effective exclusion list computed by the kernel. The #1198/#1277 batch-read fold->re-read remedy becomes one entry, ["read"], without restating — or freezing a copy of — the built-in list (acp-kernel >= 0.0.93). Effective exclusion = (neverPreserveRecentTools ?? built-in) minus preserveRecentTools; composable with an explicit never-list; unset passes through; [] rejected as a near-certain typo for neverPreserveRecentTools: []. Refs #1277
|
Added the positive-facing companion knob on top of the review fixes (rebased onto 9e1a889):
{ "compress": { "preserveRecentTools": ["read"] } } // the one-entry #1198/#1277 remedyEffective exclusion = Tests: +3 plumbing (parse/merge/resolve) and +4 kernel e2e via the packed #428 tarball — file 13/13, typecheck clean. Docs: README + CONFIGURATION (en/zh) present it as the preferred form, with the never-list repositioned as the advanced verbatim-replace form. Kernel pin bump to a real 0.0.93 follows after acp-kernel#428 is merged & released (the tarball install is |
[bot] 🏷 新 commit 设计评估(过):正向旋钮消除了 verbatim-replace 陷阱和「手抄内置列表冻结」问题, ⚠ CI 红点(按 CI 同款环境复现:committed lockfile → npm ci → kernel 0.0.92):
两条路,建议 A:
顺手小修已推(labeled commit 中文摘要:preserveRecentTools 正向旋钮的设计与文档我都认可并已在 PR 里补上 Web UI i18n 漏项,但该半程依赖尚未发布的 acp-kernel 0.0.93(#428 还开着),当前 committed pin 0.0.92 下 typecheck 2 错 + 2 个内核 e2e 红——建议先合 kernel #428 发 0.0.93 后由我补 pin bump,或拆出绿色的 neverPreserveRecentTools 半程先合。 |
validateConfig probe: on older kernels the knob is an unknown config key (no error emitted) so the four plumbing tests still run while the kernel-behaviour tests skip; once the pin reaches >= 0.0.93 they activate everywhere. Keeps CI green through the 0.0.92 -> 0.0.93 window (acp-kernel#428).
….0.92
ResolvedKernelConfig = Config & { preserveRecentTools?: string[] } —
applyCompressSettings/resolveRequestConfig return the intersection so
both release windows (pin 0.0.92 now, >= 0.0.93 after acp-kernel#428)
compile identically; older kernels ignore the extra key.
Skip-guarded kernel-e2e tests activate with the real npm package.
Exposes kernel
neverPreserveRecentTools(acp-kernel #395, released in 0.0.92 — pin bumped here) as acompressconfig key: tool-name patterns excluded from the soft-protected recent zone, so matching tool results inside the recent window become compressible immediately instead of aging out first.Why (#1277 / #1198)
The kernel built-in list
["decompress", "search_context", "read", "bash"]keepsread/bashcompressible because they are the largest reclaimable mass — but in batch-read workflows (opencode + deepseek-v4.1-flash in #1198: window correctly detected at 1M, usage 11–18%) the flat-T1 compression cadence folds freshly-read files right away → the model re-reads them → growth triggers another fold → death loop (9 compressions in 26 min; turning compression off unblocks).Recommended remedy (owner guidance on #1277): remove only
readfrom the list —{ "compress": { "neverPreserveRecentTools": ["decompress", "search_context", "bash"] } }— fresh read results then stay in the recent zone and age out by position later (unlike
protectedLatestTools, which would pin the newest read forever). Do not clear the list to[]as a habit: re-includingdecompress/search_contextpins just-restored blocks in the recent zone where they become unreclaimable — a different disease.[]remains a valid max-protection escape hatch (deliberately NOT rejected, unlikeprotectedTools/protectedLatestToolswhich reject empty arrays).Changes
src/config.ts:compress.neverPreserveRecentToolsparsing + validation (separate branch — empty array passes; non-strings / empty strings reject the whole value, same policy class as the other knobs)src/compress-settings.ts:mergeCompressdeepest-wins whole-array replace;applyCompressSettingsfallback to baseresolveRequestConfigpathchore: pin acp-kernel 0.0.92Tests
tests/never-preserve-recent-tools.test.ts(7):[]valid escape hatch,"read"/[42]/[""]/[null]reject[]does NOT fall back to shallower list, unset stays undefined[]included), unset → kernel built-in governsreadremoved → range refuses with/protected/i, read untouched;[]→ same refusalPlumbing tests red-on-master (key absent → undefined); e2e tests require kernel >= 0.0.92. Config-surface regression set (28 files, 553 tests incl. compress-settings/config consumers): 0 failures.
Fixes #1277