Skip to content

refactor: delegate historical-image strip to acp-kernel wire primitive (#617) - #635

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-09-08_issue617-strip-images-kernel-adopt
Open

refactor: delegate historical-image strip to acp-kernel wire primitive (#617)#635
ranxianglei wants to merge 1 commit into
masterfrom
2026-09-08_issue617-strip-images-kernel-adopt

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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: stripHistoricalImages imported from acp-kernel/wire alongside the protocol codecs; the runPrepare injection point is untouched (same call shape, same [debug] strip-images log line, same identity-no-op semantics).
  • src/compress-settings.ts: DEFAULT_STRIP_IMAGES_KEEP_RECENT = 5 moved here — host-side policy stays host-side, mechanism lives in the kernel.
  • src/config.ts: stripImages docstring updated to reference the kernel primitive (was pointing at the deleted local module).
  • src/strip-images.ts: deleted (per-protocol traversal duplicated from src/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.
  • No pin bump: already pinned 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 — clean
  • full suite: 1240 tests, 1239 pass, 0 regressions. The one failure (resolveClientCommand: codex/claude resolve to themselves) fails identically on pristine master in this sandbox — /usr/bin/codex + /usr/bin/claude are installed here, CI runners have neither; pre-existing, environment-dependent, unrelated to this change.
  • strip suites (tests/strip-images.test.ts + tests/strip-images-compact.test.ts): 9/9 pass against the kernel export
  • tsup build succeeds; acp-kernel/wire inlined into dist/index.js as before

No 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.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

📦 Built Package Artifact

Branch: 2026-09-08_issue617-strip-images-kernel-adopt (bd4fecc)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-635

Each push to this PR publishes a new version under the pr-635 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr635.tgz
npm install -g package

This comment is automatically updated on each push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant