fix: compress over unpruned view + acp-kernel 0.0.38 (billion-context-pi#195) - #194
Closed
ranxianglei wants to merge 5 commits into
Closed
fix: compress over unpruned view + acp-kernel 0.0.38 (billion-context-pi#195)#194ranxianglei wants to merge 5 commits into
ranxianglei wants to merge 5 commits into
Conversation
…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.
…into 2026-08-22_promote-after-prune
ranxianglei
force-pushed
the
2026-08-22_promote-after-prune
branch
3 times, most recently
from
August 22, 2026 15:38
b8f0b8c to
03da87f
Compare
…lock (billion-context-pi#195/#199)
ranxianglei
force-pushed
the
2026-08-22_promote-after-prune
branch
from
August 22, 2026 15:47
03da87f to
404e240
Compare
Owner
Author
|
Superseded: split into feature PR (this fix) + #193, then a clean release branch from master. See dog/billion-context-pi#10. |
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.
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 withacp_summary_*stripped bystripKernelSummaries) toapplyCompression. 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 dedicatedcompressMessagesfield (unprunedoriginalMessages) used only byapplyCompression; wire rebuilds (patchResponsesInput) keep using the pruned view.originalMessagesbrokegrow-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.
npm ciuntil acp-kernel 0.0.38 is published (lockfile integrity still carries the 0.0.37 hash). Merge order: acp-kernel PR #122 first → oncenpm view acp-kernel version= 0.0.38, runnpm install && git commit --amend --no-edit && git push -fon this branch (or ask the bot), then merge.