Skip to content

Conversation

@cristipufu
Copy link
Member

@cristipufu cristipufu commented Dec 27, 2025

Description

This PR fixes the interrupt detection logic in the LangGraph runtime and adds comprehensive tests for parallel branches with triggers. The key fix changes the _is_interrupted method to also check for actual interrupts (state.interrupts) rather than only scheduled nodes (state.next), which more accurately identifies when execution is truly suspended due to interrupts.

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-langchain==0.2.2.dev1003801749",

  # Any version from PR
  "uipath-langchain>=0.2.2.dev1003800000,<0.2.2.dev1003810000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-langchain = { index = "testpypi" }

@cristipufu cristipufu self-assigned this Dec 27, 2025
@cristipufu cristipufu force-pushed the fix/resumable_tests branch 2 times, most recently from fec857b to af306bd Compare December 27, 2025 15:57
Comment on lines +358 to +373
# Define nodes that interrupt twice sequentially
def branch_a_first(state: State) -> State:
result = interrupt({"message": "Branch A - First interrupt"})
return {"branch_a_first_result": f"A-1 completed with: {result}"}

def branch_a_second(state: State) -> State:
result = interrupt({"message": "Branch A - Second interrupt"})
return {"branch_a_second_result": f"A-2 completed with: {result}"}

def branch_b_first(state: State) -> State:
result = interrupt({"message": "Branch B - First interrupt"})
return {"branch_b_first_result": f"B-1 completed with: {result}"}

def branch_b_second(state: State) -> State:
result = interrupt({"message": "Branch B - Second interrupt"})
return {"branch_b_second_result": f"B-2 completed with: {result}"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be better to define 2 nodes with 2 interrupts each

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, added more tests and actually found some bugs

This comment was marked as outdated.

@cristipufu cristipufu force-pushed the fix/resumable_tests branch 7 times, most recently from e213723 to 8234611 Compare December 30, 2025 09:06
@cristipufu cristipufu merged commit 4dd44cf into main Dec 30, 2025
39 checks passed
@cristipufu cristipufu deleted the fix/resumable_tests branch December 30, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants