Conversation
Collaborator
|
Thanks for the focused regression fix. The R1 premise is present on current main: Suggested changes
No blocking correctness issue identified. This is an automated hermes-sweeper review. |
|
Merged via #63965 — your fallback compaction commit was cherry-picked with authorship preserved and extended with a boundary-scoped persisted breaker that survives ordinary fitting responses, usage-less turns, session rotation, and gateway recreation. Thanks for the fix! |
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.
What does this PR do?
Treats deterministic fallback compactions as degraded attempts in the existing anti-thrash guard.
Today, a failed summary call can still shrink the prompt enough that the next real
prompt_tokensreading falls below threshold and resets_ineffective_compression_countback to0. That lets repeated empty-summary fallback rewrites loop indefinitely without ever tripping the existing breaker. This patch keeps the real-usage-based guard intact, but consumes a strike whenever the completed compaction had to fall back to the placeholder summary.Related Issue
Part of #63008
Type of Change
Changes Made
agent/context_compressor.py: preserve anti-thrash strikes when a verified compaction used the deterministic fallback summary, even if the resulting prompt fits under threshold.agent/context_compressor.py: log fallback-marker compactions as degraded attempts through the same ineffective-compression counter.tests/agent/test_context_compressor.py: add coverage for fallback strikes, normal successful reset behavior, and the second-strike suppression path.How to Test
/Users/leongong/Desktop/LeonProjects/worktrees/hermes-agent/.base/.venv/bin/python -m pytest tests/agent/test_context_compressor.py -q/Users/leongong/Desktop/LeonProjects/worktrees/hermes-agent/.base/.venv/bin/python -m py_compile agent/context_compressor.py tests/agent/test_context_compressor.pygit diff --checkChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Proof log:
/tmp/hermes-63008-proof.txt