Repository navigation
feat(compaction): add compaction_threshold_tokens and scale background threshold - #5085
Merged
Merged
Conversation
…d threshold Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
rumpl
force-pushed
the
feat/compaction-threshold-tokens
branch
from
December 1, 2026 12:18
d18fc1a to
fd55e48
Compare
rumpl
enabled auto-merge
December 1, 2026 12:32
aheritier
approved these changes
Dec 1, 2026
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
compaction_threshold_tokenstomodels.<name>andagents.<name>inpkg/config/latest,agent-schema.json, and the generated TypeScript SDK, letting users configure proactive auto-compaction by an absolute token count (capped at the model's context window) instead of a context-window fraction.> 0, mutually exclusive withcompaction_thresholdon the same model/agent, and cannot be combined withfirst_available.compaction_thresholdorcompaction_threshold_tokens) takes precedence over agent-level threshold.compaction_threshold_tokensrelative to the context limit.background_compaction_threshold(user settings, 1–99%, default 70) to be a percentage of the agent's effective blocking compaction threshold (compaction_thresholdorcompaction_threshold_tokens) rather than the raw model context window, ensuring background compaction always scales with and fires before blocking compaction.