fix(compressor): reset _summary_failure_cooldown_until in on_session_reset() - #15548
Closed
nftpoetrist wants to merge 1 commit into
Closed
fix(compressor): reset _summary_failure_cooldown_until in on_session_reset()#15548nftpoetrist wants to merge 1 commit into
nftpoetrist wants to merge 1 commit into
Conversation
…reset() on_session_reset() cleared _previous_summary, _last_summary_error, and _ineffective_compression_count but left _summary_failure_cooldown_until intact. When a transient summary error sets a 60 s cooldown (or 600 s for a missing-provider RuntimeError) and the user immediately runs /reset or /new, the cooldown carries into the new session. If the new session reaches the compression threshold before the cooldown expires, _generate_summary() returns None early, middle turns are silently dropped without a summary, and the agent continues with no indication that compaction was skipped. Fix: set _summary_failure_cooldown_until = 0.0 in on_session_reset(), matching the value assigned in __init__ and symmetric with the other per-session fields already cleared there. Fixes NousResearch#15547
Contributor
|
Salvaged via #19622 onto current main - your commit authorship was preserved. Thanks! |
19 tasks
nftpoetrist
added a commit
to nftpoetrist/hermes-agent
that referenced
this pull request
May 10, 2026
…session reset _generate_summary() clears self.summary_model = "" when the configured aux model fails (404, 503, timeout) and falls back to the main model for the current compression call. This mutation is permanent for the lifetime of the ContextCompressor instance. Because the same instance is reused across /reset (run_agent.py calls on_session_reset() rather than recreating the compressor), every subsequent session silently uses the main model for compression instead of the configured aux model — even after a transient outage resolves. on_session_reset() already resets _summary_failure_cooldown_until to 0 so transient errors do not block a fresh session (fix NousResearch#15548). The same logic applies to summary_model: a per-session failure should not permanently degrade compression quality for subsequent sessions. Fix: store the originally configured value in _configured_summary_model at __init__ time, then restore summary_model from it in on_session_reset(). Also reset _summary_model_fallen_back to False so the one-shot fallback can fire again if the aux model fails in the new session. Fixes companion to NousResearch#15548
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?
ContextCompressor.on_session_reset()clears_previous_summary,_last_summary_error, and_ineffective_compression_countbut leaves_summary_failure_cooldown_untilintact. When a transient summary error (network timeout, rate limit) sets a 60 s cooldown — or 600 s when no auxiliary provider is configured — and the user immediately runs/resetor/new, the cooldown carries into the new session. If the new session reaches the compression threshold before the cooldown expires,_generate_summary()returnsNoneearly: middle turns are silently dropped without a summary and the agent continues with no indication that compaction was skipped.One-line fix in
on_session_reset(): set_summary_failure_cooldown_until = 0.0, matching the value assigned in__init__and symmetric with the other per-session fields already cleared there. Scoped to session reset only — no behavior change for sessions that never hit an error.Related Issue
Fixes #15547
Type of Change
Changes Made
agent/context_compressor.py: addself._summary_failure_cooldown_until = 0.0toon_session_reset()(+1 line)How to Test
_generate_summary)_summary_failure_cooldown_untilis set to a future timestampon_session_reset()_summary_failure_cooldown_until == 0.0Checklist
Code
Documentation & Housekeeping