mirror of
https://github.com/langchain-ai/agent-chat-ui.git
synced 2026-07-21 03:15:23 -04:00
[PR #263] Fix: Resume graph on generic/custom interrupts instead of starting a new run #265
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langchain-ai/agent-chat-ui/pull/263
Author: @geoffreyp
Created: 4/3/2026
Status: 🔄 Open
Base:
main← Head:main📝 Commits (1)
755c5fffeat: handle generic interrupts with Command(resume=...) to prevent graph restart📊 Changes
1 file changed (+46 additions, -17 deletions)
View changed files
📝
src/components/thread/index.tsx(+46 -17)📄 Description
fix issue
https://github.com/langchain-ai/agent-chat-ui/issues/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.
action_requests/review_configs)ThreadViewCommand(resume=...)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.