Skip to content

fix(langgraph): skip RESUME writes in _prepare_state_snapshot so get_state().next is correct after double interrupt#6958

Open
GAUTAM V DATLA (gautamvarmadatla) wants to merge 1 commit intolangchain-ai:mainfrom
gautamvarmadatla:fix/get-state-next-after-double-interrupt
Open

fix(langgraph): skip RESUME writes in _prepare_state_snapshot so get_state().next is correct after double interrupt#6958
GAUTAM V DATLA (gautamvarmadatla) wants to merge 1 commit intolangchain-ai:mainfrom
gautamvarmadatla:fix/get-state-next-after-double-interrupt

Conversation

@gautamvarmadatla
Copy link

@gautamvarmadatla GAUTAM V DATLA (gautamvarmadatla) commented Feb 27, 2026

_prepare_state_snapshot and _aprepare_state_snapshot skipped ERROR and INTERRUPT writes when replaying pending_writes into task.writes, but did not skip RESUME writes.

When a node calls interrupt() twice, commit() persists both (task_id, INTERRUPT, ...) and (task_id, RESUME, ...) to pending_writes. On the next get_state() call, the RESUME write was incorrectly replayed into task.writes, making the write list non-empty and excluding the task from StateSnapshot.next. This made the graph appear finished even though it was still paused waiting for user input.

Fixed by adding RESUME to the skip condition in both sync and async paths, consistent with _match_writes which already skipped RESUME correctly.

fixes: #6956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant