Repository navigation
fix(compaction): keep the idle gap across gateway turn-start resets (RIG-9162) - #51
Open
rigel-mintaka wants to merge 2 commits into
Open
rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
Collaborator
Author
Review roundsRound 1 (107f54f): 0 high, 1 medium, 5 low.
Round 2 (interdiff 107f54f..e27ac75): 0 high, 0 medium, 1 low (a wordy comment; non-gating). 11 passed; ruff is clean. All-clear on e27ac75. |
rigel-mintaka
marked this pull request as ready for review
November 10, 2026 19:18
…RIG-9162) Co-authored-by: Matt Wilkinson <matt@rigel.build>
…G-9162) Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
hermes-sync/rig-9162-keep-the-idle-gap-across-gateway-turn
branch
from
November 10, 2026 23:59
e27ac75 to
71e3a1f
Compare
Collaborator
Author
This branch has not been deployed
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?
Idle compaction (
compression.idle_compact_after_seconds) never fired on gateway turns, such as Discord, Cotal and cron._idle_compactionmeasuredtime.time() - _last_activity_ts, but two turn-start paths reset that timestamp first, so the gap was always about 0:gateway/run.py_init_cached_agent_for_turn(cached agent reuse);DurableTurnLease.start.Related Issue
RIG-9162. Nemo enables idle compaction after this ships (RIG-9148).
Type of Change
Changes Made
gateway/run.pyandagent/turn_facade_lease.py: save the elapsed gap into_idle_resume_gap_sbefore the clock reset, keeping the larger value if both run. The watchdog reset is unchanged.agent/turn_context_compaction.py:_idle_compactionreads and clears the saved gap, and falls back to the live gap if none was saved.tests/agent/test_compression_trigger_labels.py: a regression for the cached-turn reset path.How to Test
DID NOT RAISE _CompressionReached) and passes after.Checklist
Code
Documentation & Housekeeping
For New Skills
N/A.
Screenshots / Logs
N/A.
Refs RIG-9162
Co-authored-by: Matt Wilkinson matt@rigel.build