fix(compression): break infinite loop when aux model context < session size (#53008) - #53235
Closed
Christopher-Schulze wants to merge 1 commit into
Closed
Conversation
Christopher-Schulze
force-pushed
the
fix/53008-compression-infinite-loop
branch
3 times, most recently
from
July 1, 2026 13:01
ba0353c to
64e9348
Compare
Closed
3 tasks
Christopher-Schulze
force-pushed
the
fix/53008-compression-infinite-loop
branch
from
July 12, 2026 11:53
64e9348 to
d3fc655
Compare
Contributor
|
Thanks for the focused compression investigation and regression coverage. This is an automated hermes-sweeper review. Current
|
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
Fixes #53008. When Hermes uses an auxiliary compression model with a smaller context window than the main model, compression could repeatedly re-trigger without producing enough headroom.
Root cause
Fix
MINIMUM_CONTEXT_LENGTH.compress()compares the actual middle window with auxiliary context. Oversized windows use the main runtime for that pass, then restore the configured auxiliary model infinally.call_llm(task="compression")cannot re-select the auxiliary task configuration.Current
mainalready contains provider-token anti-thrash verification. This rebase deliberately removes the PR's older threshold-escape implementation instead of duplicating that upstream behavior.Verification
scripts/check.sh --project hermes-agent --worktree worktrees/hermes-agent/53008: PASSuv lock --check, and fullruff check .: PASS7b5ba2054721dde998ed47fd4a0f031955278e99: 6 regression failures on base, all pass on this branchgit diff --check origin/main: PASSFull-project
tyremains advisory and hits its existing upstream panic intools/checkpoint_manager.py; the blocking project gates pass.