refactor: delegate historical-image strip to acp-kernel wire primitive (#617) - #635
Open
ranxianglei wants to merge 1 commit into
Open
refactor: delegate historical-image strip to acp-kernel wire primitive (#617)#635ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-635Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr635.tgz
npm install -g packageThis comment is automatically updated on each push. |
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.
What
Completes the rewire step planned in #617: the opt-in historical-image strip that #618 implemented locally (
src/strip-images.ts) now delegates to the kernel's wire-layer primitive.src/server.ts:stripHistoricalImagesimported fromacp-kernel/wirealongside the protocol codecs; therunPrepareinjection point is untouched (same call shape, same[debug] strip-imageslog line, same identity-no-op semantics).src/compress-settings.ts:DEFAULT_STRIP_IMAGES_KEEP_RECENT = 5moved here — host-side policy stays host-side, mechanism lives in the kernel.src/config.ts:stripImagesdocstring updated to reference the kernel primitive (was pointing at the deleted local module).src/strip-images.ts: deleted (per-protocol traversal duplicated fromsrc/image-tokens.ts).tests/strip-images.test.ts: retargeted at the bundled kernel export — retained as host-level regression coverage of the exact code path the proxy runs.acp-kernel@0.0.59, which ships the primitive (kernel fix(responses): remap round-2 message lifecycle so codex stops dropping text deltas #215, released in v0.0.58+).Why
Single source of truth: the pi adapter (billion-context-pi#321, PR billion-context-pi#324) shares the kernel implementation, so cutoff /
[image]-placeholder / no-op semantics can't drift between hosts. Siblings: acp-kernel#215 (mechanism), acp-kernel#218 (v0.0.58 release).Validation (against published acp-kernel@0.0.59, clean
npm ci)tsc --noEmit --project tsconfig.build.json— cleanresolveClientCommand: codex/claude resolve to themselves) fails identically on pristine master in this sandbox —/usr/bin/codex+/usr/bin/claudeare installed here, CI runners have neither; pre-existing, environment-dependent, unrelated to this change.tests/strip-images.test.ts+tests/strip-images-compact.test.ts): 9/9 pass against the kernel exporttsupbuild succeeds;acp-kernel/wireinlined intodist/index.jsas beforeNo behavior change: identical semantics (recent-N kept, image-only messages collapse to an
[image]placeholder, identity no-op when nothing changed), verified by the retargeted tests running against the kernel implementation.