Skip to content

Conversation

casparb
Copy link
Collaborator

@casparb casparb commented Oct 8, 2025

Note

The original PR was reverted in #6252 because it was breaking CI in langgraph-api due to a bug where invoking an interrupted graph with None would cause duplicate interrupt writes to appear in the task. This has been fixed and a test has been added to verify this:

  • test_invoke_interrupted_graph_with_none

Description

Prevents interrupt tasks from executing when the resume value has not yet been specified.

Implemented for sync and async Pregel loop

If a task execution is skipped, the skipped interrupt is still included in the graph result for consistency:

result = graph.invoke(...)
interrupts = result.get("__interrupt__", [])   # [interrupt_1, interrupt_2]

partial_result = graph.invoke(Command(resume=interrupt_1_resume_map), ...)
remaining_interrupts = partial_result.get("__interrupt__", [])  # [interrupt_2]

Tests

  • test_interrupt_with_send_payloads: test for a single resume map that resumes all interrupts at once
  • test_interrupt_with_send_payloads_sequential_resume: test for two resume maps delivered in sequence
  • test_node_with_multiple_interrupts_requires_full_resume test optimization for multiple interrupts within a single node

Solves #6208

Copy link

vercel bot commented Oct 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langgraph-docs-preview Ignored Ignored Preview Oct 9, 2025 9:37pm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants