Repository navigation
fix(hermes): resume interrupted turns after a gateway restart (RIG-12326) - #248
Open
rigel-mintaka wants to merge 1 commit into
Open
rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
…326) Startup settlement auto-resumes an interrupted admission and releases the pre-claim before handler dispatch, so followers run without /discard. A turn that was compressing when the gateway crashed stays unknown: the compression publish marks that admission in the same transaction, and startup holds only marked admissions. Reset children resume normally. Refs: RIG-12326 Co-Authored-By: Matt Wilkinson <matt@rigel.build> Co-authored-by: Matt Wilkinson <matt@rigel.build>
Contributor
Author
|
Review rounds (one review agent each):
Only the commit message changed since Step-up signal: plain implement (Impl12326) stalled 17 min reading and was cancelled; the slice moved to implement-hard. |
Contributor
Author
|
All-clear at f6ebdc5 |
Contributor
Author
|
Rebased-head retest at |
This branch had an error being 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 do
After a gateway restart, Hermes resumes a turn that was interrupted mid-run instead of leaving it
unknownuntil someone runs /discard. Startup settlement auto-resumes the interrupted admission and releases the pre-claim before handler dispatch. The turns queued behind it then run in order.One case still waits for explicit recovery: a turn that was compressing its transcript when the gateway crashed. Its state may be half-published, so it stays
unknownand its followers stay blocked. The compression publish now marks the admission that compressed, in the same transaction. Startup holds only that admission, not later turns on a conversation compressed earlier. Reset children resume normally.Why do we need it
Every gateway restart left Nemo's in-flight turn stuck until Matt ran /discard by hand. Matt ruled to auto-resume after a crash and drop the "never replay started work" rule.
Summary
run_startup.py: resume interrupted admissions and fence the one that was compressing.hermes_state_compression.py: record the compressing admission inside the publish transaction.session_authority*.py: owner lookup is guarded per store.test_restart_resume_pending.py: covers resume, a second compression, reset then compress, compress then reset, and an earlier compression followed by a worker turn.Verification
On macpro2013: 77 passed, 3 failed across six files. All three also fail on main
ea056ebd:test_journey_compress_restart_fifo[graceful]and[crash](SUMMARY_RETAINED_FACTS), and the open-prompts[crash]WebSocket handshake timeout. Six review rounds; the last is clean at1fc6621c. Probes p1–p6 run against the real reset and compression paths: in-flight compressions stayunknown, and reset children and later turns auto-resume.Risks
A wrong fence would either replay a half-compressed turn or hold a healthy one at
unknown. The probes cover both directions.Rollback: revert this commit.
Spec impact
Spec-impact: none.
Checks skipped:
nebula has no pre-push hook config; GitHub Actions ci.yaml runs its checksRefs RIG-12326
Co-authored-by: Matt Wilkinson matt@rigel.build