Skip to content

Fix: Resume graph on generic/custom interrupts instead of starting a new run#263

Open
Geoffrey Pruvost (geoffreyp) wants to merge 1 commit intolangchain-ai:mainfrom
geoffreyp:main
Open

Fix: Resume graph on generic/custom interrupts instead of starting a new run#263
Geoffrey Pruvost (geoffreyp) wants to merge 1 commit intolangchain-ai:mainfrom
geoffreyp:main

Conversation

@geoffreyp
Copy link
Copy Markdown

fix issue

#262

Problem

When a LangGraph backend uses interrupt() with a custom/generic payload (i.e. not the standard HumanInterrupt schema with action_request / config), the chat input always sends the user's response as a new run. This causes the graph to restart from START, re-triggering the interrupt() node in an infinite loop instead of resuming execution.

Only interrupts matching the isAgentInboxInterruptSchema format (with action_requests and review_configs) were properly handled via Command(resume=...) through the ThreadView / agent-inbox components. Any other interrupt format — like a simple {"type": "human_input_request", "message": "..."} — was displayed read-only via GenericInterruptView with no way to resume the graph from the chat input.

Solution

Modified handleSubmit in src/components/thread/index.tsx to detect when there is a pending interrupt that is not a standard HITL interrupt. In that case, the user's message is sent as Command(resume=input) instead of new input, allowing the graph to resume correctly.

Scenario Before After
Standard HITL interrupt (action_requests/review_configs) ✅ Handled by ThreadView ✅ No change
Generic/custom interrupt ❌ Chat input starts new run → infinite loop ✅ Chat input sends Command(resume=...)
No interrupt (normal chat) ✅ Normal submit ✅ No change

…raph restart

When a non-HITL interrupt is pending, resume the graph using Command(resume=...) instead of submitting new messages. This prevents the graph from looping back to START for custom/generic interrupts.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

Geoffrey Pruvost (@geoffreyp) is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant