Files
langgraph/libs
Igor SoarezandGitHub e6cf9ea667 fix(langgraph): stop reporting answered interrupts in get_state (#9103)
Execution, snapshots, and resume checks interpreted the same pending
writes separately.

When one of several interrupted tasks finished after resuming,
`get_state()` still reported its answered question as pending.

Use `read_task_statuses()` across execution, state reads, and resume
checks.
An output write marks a task finished; `RESUME` alone does not, since
the
task may pause again. Record `NO_WRITES` when a resumed task completes
without output, so it isn't run again.

Latest-state reads now omit interrupts from finished tasks. History and
explicit checkpoint reads still show the last recorded interrupt per
task. A task paused at its second interrupt appears in `next` with
`result=None`. `Command(resume=value)` without an id now raises when
more than one interrupt is pending, including in a subgraph.

Threads paused before this change, where a resumed task finished without
output, still show that task as unfinished. It appears in `next` and its
answered interrupt counts as pending, so if another interrupt is also
pending, `Command(resume=value)` without an id raises. Resume these
threads by interrupt id. On SQLite and Postgres, insert-ignore can leave
an old `RESUME` value for a finished task; that task does not run again.

Fixes #6956
Fixes #8579

Thanks to @gautamvarmadatla and @russeell for reporting these.
2026-10-02 11:02:27 -04:00
..