Skip to content

fix: compress over unpruned view + acp-kernel 0.0.38 (billion-context-pi#195) - #194

Closed
ranxianglei wants to merge 5 commits into
masterfrom
2026-08-22_promote-after-prune
Closed

fix: compress over unpruned view + acp-kernel 0.0.38 (billion-context-pi#195)#194
ranxianglei wants to merge 5 commits into
masterfrom
2026-08-22_promote-after-prune

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Two changes, both needed for the #195 promote-after-prune fix to work in this proxy:

1. Host fix (the important one): the streaming loop ctx passed processedMessages (= pruned view with acp_summary_* stripped by stripKernelSummaries) to applyCompression. Active blocks whose raws were pruned had NO resolvable anchor in that view — not even the kernel 0.0.37+ summary-anchor fix can help when the summaries are stripped. Added a dedicated compressMessages field (unpruned originalMessages) used only by applyCompression; wire rebuilds (patchResponsesInput) keep using the pruned view.

  • Found via e2e: naively switching the whole ctx to originalMessages broke grow-and-compress keeps upstream context bounded (post-compress re-requests would send the full log upstream — 113KB bodies). The split-view design fixes both.

2. Merged PR #193 (openai-system-hoist adaptation) — required because kernel 0.0.37+ changed openai wire system handling (2 wire tests fail without it). Rides along; close #193 after this merges.

3. acp-kernel 0.0.36 → 0.0.38 (the #195 fix, acp-kernel PR #122).

Validated locally against the acp-kernel v0.0.38 build (dist overlaid): typecheck clean, 512/512 tests pass (incl. grow-and-compress e2e + openai wire tests), build OK.

⚠️ CI will fail at npm ci until acp-kernel 0.0.38 is published (lockfile integrity still carries the 0.0.37 hash). Merge order: acp-kernel PR #122 first → once npm view acp-kernel version = 0.0.38, run npm install && git commit --amend --no-edit && git push -f on this branch (or ask the bot), then merge.

ranxianglei and others added 4 commits August 22, 2026 19:44
…0.37)

The kernel hoists the contiguous leading system/developer prefix out of
the openai fold space (system content is host runtime state - it must not
feed ids/fingerprints, and a compression covering it used to delete the
model's system prompt from every rebuilt payload). The proxy must now
carry it around the fold:

- prepareOpenai captures systemText from openaiToCore and re-injects it
  (client system first, compress prompt after) into every rebuilt payload
- Prepared.openapiSystemText flows into pickAdapter so compress-loop
  rounds re-inject it too, mirroring the anthropic adapter's
  anthropicSystem path
- createOpenaiAdapter gains a clientSystem param
…xt-pi#195)

The streaming loop ctx passed processedMessages (pruned view with
acp_summary_* stripped) to applyCompression, so active blocks whose raws
were pruned had no resolvable anchor — bN promotion failed with the
self-contradictory 'already compressed' error. Add a dedicated
compressMessages field (unpruned originalMessages) used only by
applyCompression; wire rebuilds keep using the pruned view.
@ranxianglei
ranxianglei force-pushed the 2026-08-22_promote-after-prune branch 3 times, most recently from b8f0b8c to 03da87f Compare August 22, 2026 15:38
@ranxianglei

Copy link
Copy Markdown
Owner Author

Superseded: split into feature PR (this fix) + #193, then a clean release branch from master. See dog/billion-context-pi#10.

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