Repository navigation
fix(context): state the messages-only basis in the proactive-compression log lines - #15055
Merged
diegosouzapw merged 1 commit intoSep 29, 2026
Conversation
…ion log lines Refs diegosouzapw#14931. Part 3 of a 3-part series on the context-guard false kill: - Part 1: sibling-side limit resolution (combo limits) - Part 2: estimator calibration against provider-reported usage - Part 3 (this PR): log basis labels An empirical probe (chat and responses shapes, tools-heavy body) shows the current pipeline already logs the same messages-only basis on both inbound formats — the per-format inconsistency reported in diegosouzapw#14931 died with the modular compression rewrite. What remained confusing was reading that number next to the final guard's full-breakdown rejection ('Proactive compression triggered: 17,508' vs 'estimated 67,541'): nothing said the first excludes tools. State the basis and the tools reserve in both log lines. Log text only; no behavior change.
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.
TL;DR (plain language)
Proactive compression triggered: 17,508 tokens > ...sitting two lines aboveInput exceeds context window ... estimated 67,541reads like a bug — it isn't. The first number is messages-only (tools are accounted separately as the threshold's reserve); the second is the full breakdown. Nothing said so, so this labels both log lines with their basis.An empirical probe (chat and responses shapes, tools-heavy body) confirmed the current pipeline already logs the same messages-only basis on both inbound formats — the per-format inconsistency reported in #14931 died with the modular compression rewrite. Only the missing label remained.
Change
Proactive compression triggered: X message tokens > Y threshold (Z limit, tools reserve R)Context compressed: A → B message tokens (layers: ...)Log text only; no behavior change.