Skip to content

Strip consumed compress pairs from the upstream wire (kernel >=0.0.32 compat) - #185

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-22_strip-consumed-compress-wire
Open

Strip consumed compress pairs from the upstream wire (kernel >=0.0.32 compat)#185
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-22_strip-consumed-compress-wire

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Why

acp-kernel 0.0.32 (kernel #104/#105, KEEP_LAST_ORPHANED 0 → 2) keeps the newest orphaned compress call+result pairs visible in processTurn output. The proxy's upstream contract requires consumed compress calls to stay off the wire.

What

src/server.ts: stripKernelSummaries(messages, state) now also drops compress call+result pairs that are neither active-block-linked (their args carry the live summary) nor failures (FAILED marker) — rejections stay visible to the model. Core tool-results carry no toolName, so calls and results are paired by toolCallId across all four strip sites (anthropic / openai / responses / count_tokens).

Tests

  • npm run typecheck
  • tests 512/512 (incl. plugin-protocol "consumed range folds away")
  • No-op under kernel < 0.0.32 (the kernel already hid orphaned pairs there).

Follow-up

A separate bump-only release PR (acp-kernel 0.0.32 → v0.1.45) will follow after this merges — no version changes in this PR.

… >=0.0.32

Kernel 0.0.32 restores KEEP_LAST_ORPHANED=2: the newest orphaned
compress call+result pairs stay in processTurn output so models can
observe their own failures (billion-context-pi#9). The proxy wants
consumed calls OFF the upstream wire: stripKernelSummaries now also
drops compress pairs that are neither active-block-linked (their args
carry the live summary) nor failures ("FAILED" marker) — rejections
stay visible. Core tool-result messages carry no toolName, so calls
and results are paired by toolCallId.
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