Repository navigation
Conversation
fazxes
force-pushed
the
fazxes/provider-written-compaction
branch
2 times, most recently
from
November 12, 2026 22:59
d72e656 to
cff4c8f
Compare
- On models whose provider can compact a conversation, fx asks the provider to compact it, and later requests send the provider's block, then the newest 4 turns unchanged with their reasoning. - If the provider's compaction fails, fx writes its own summary and keeps no turns after it. - After a model switch, the earlier model's kept steps are sent as text. - Models without provider compaction keep fx's own compactor. - Stopping a compaction while the provider writes its block leaves the conversation as it was. - A session killed after the block is saved resumes with the block and the kept turns. - A running turn that doesn't fit is compacted whole, and only its message follows the block. - A request the provider refuses for its size is compacted with fx's summary and sent again. - `/compact` on these models runs right before the next message is sent. - Resuming a session compacted in the middle of a turn no longer drops the steps saved after the compaction.
… dropped /compact
fazxes
force-pushed
the
fazxes/provider-written-compaction
branch
from
November 22, 2026 20:50
e615086 to
e0517b3
Compare
This branch has not been deployed
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.
Summary
/compacton these models runs right before the next message is sent.Why
Before and after
/compacton these models now shows "Context will be compacted before your next message." and compacts right before that message is sent, the one request the provider can compact exactly as it was sent.Tests
tests/e2e/provider-compaction.test.tsdrives the built binary through a fake AI Gateway: both providers' blocks, each fallback (error statuses, no block, an answer, empty, cut and oversized replies), a model switch,/compact, a stopped compaction, a kill and resume, 30-turn sessions, a running turn compacted whole, and a request refused for its size.compaction-policy.test.tsnow counts the provider's compaction request.tests/tla/compaction/ProviderCompaction.tlamodels the cut, the block, the fallback and the kept turns.check.shruns TLC on it, shows that the old behavior breaksNoDroppedReasoning, and checks that four planted bugs each break a property.tests/tla/drivers/compaction/walks the built binary along the model.