Repository navigation
feat: protectedLatestTools config — keep latest tool snapshot across compression - #1032
Merged
Merged
Conversation
This was referenced Sep 20, 2026
Contributor
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1032Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1032.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…compression Kernel-adopt rework of the host-side todo replay (#639 / PR #637): the kernel grew a native primitive for exactly this (acp-kernel #223, protectedLatestTools, shipped in 0.0.80), so the host-side re-injection is superseded — protection now happens inside the kernel pipeline where it covers every wire and both compression modes for free. - src/config.ts: CompressSettings.protectedLatestTools (string[] of tool-name patterns, glob-capable) + strict parseCompressSettings validation (non-empty string array, entries trimmed; malformed rejects the whole compress block per the parse-state guard convention). - src/compress-settings.ts: three-level deepest-wins merge (whole-array replace) + applyCompressSettings passthrough onto the kernel Config. - tests/protected-latest-tools.test.ts: parse/merge/plumbing asserts + end-to-end kernel behavior — an explicit compress range spanning the latest todo_list pair cannot fold it (latest call+result refs render as BLOCKED, unaddressable), older instances fold normally; with no configuration everything stays foldable (default off). - Docs: CONFIGURATION.md/.zh-CN.md field reference; README.md/.zh-CN.md note next to the acp_rule protection paragraph; web UI field list. Default: none — tool names are client-specific, opt in per deployment (e.g. ["todo_list", "TodoWrite"]). Fixes #639
ranxianglei
force-pushed
the
2026-09-20_protected-latest-tools
branch
from
September 20, 2026 04:32
164e044 to
a402b3e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-PR of #637 (kernel-adopt rework; #637 was auto-closed because its head sha was accidentally pushed directly to master during a push-target mixup — the commit was immediately reverted there, master content unaffected). This PR carries the identical change on a fresh head.
Reworked per review: the host-side todo replay is superseded by acp-kernel's native
protectedLatestToolsprimitive (#223, shipped in 0.0.80, pinned on master via #1030). This is a clean single-feature commit on current master (2b027f1) that plumbs the config through and drops the host-side machinery entirely.What it does
compress.protectedLatestTools: ["todo_list", "TodoWrite"]— tool-name patterns whose latest tool-call + paired result are hard-excluded from every compress range (refs render asBLOCKED, unaddressable by suggested or explicit ranges). Older instances of the same tool fold normally, so cumulative-snapshot tools (todo/task lists) never grow unboundedly and the agent never loses its live task list to a fold.Kernel-side protection covers every wire and both compression modes for free — no per-wire wiring, no synthetic replay messages; the REAL tool-call/result stays byte-stable in place.
Changes
src/config.ts—CompressSettings.protectedLatestTools+ strictparseCompressSettingsvalidation (non-empty trimmed string array; malformed rejects the block loudly)src/compress-settings.ts— three-level deepest-wins merge (whole-array replace) +applyCompressSettingspassthrough onto the kernel Configtests/protected-latest-tools.test.ts— 6 tests: parse accept/reject, merge precedence, plumbing, end-to-end kernel behavior (spanning range cannot fold the latest pair; default stays fully foldable)CONFIGURATION.md/CONFIGURATION.zh-CN.mdfield reference,README.md/README.zh-CN.mdnote beside theacp_ruleprotection paragraph, web UI field listDefault: off (no
todo_list) — tool names are client-specific; operators opt in per deployment.Pre-flight (on this head, base master @ 2b027f1)
Fixes #639
Supersedes #637