Fix resume failing when interrupt checkpoint is buried by continuation checkpoints - #10
Open
MikaAK wants to merge 1 commit into
Open
Conversation
…n checkpoints When a graph resumes from an interrupt and the continuation saves intermediate checkpoints, the latest checkpoint no longer has pending_interrupts. A subsequent resume call would fail with :no_pending_interrupt because it only checked the single latest checkpoint. This fix adds a fallback in resume_from_checkpoint that searches through recent checkpoints (via the checkpointer's list/2) to find the most recent one with pending interrupts when the latest checkpoint has none. Scenario this fixes: 1. Graph invokes, hits interrupt at node A (checkpoint saved with interrupt) 2. Resume resolves A, graph continues to B -> C 3. Node B saves checkpoint (now latest, no interrupts) 4. Node C hits interrupt (checkpoint saved, but B's is still "latest" by created_at) 5. Second resume fails because load/1 returns B's checkpoint Now step 5 falls back to searching the checkpoint list for the interrupt checkpoint from step 4.
MikaAK
added a commit
to MikaAK/lang_ex
that referenced
this pull request
Apr 23, 2026
… + Task.start_link caller propagation (freshaengineering#11 upstream)
Collaborator
|
@claude review |
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
created_atresumecall loads only the latest checkpoint viaload/1, finds nopending_interrupts, and returns{:error, :no_pending_interrupt}resume_from_checkpoint/6that useslist/2to search recent checkpoints for the most recent one with pending interruptsScenario
pending_interruptspending_interruptsTest plan
resume finds interrupt checkpoint even when later non-interrupt checkpoints existcovering the multi-interrupt resume scenarioCheckpointerbehaviour — uses existinglist/2callback