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

Open
opened 2026-06-05 16:37:09 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/agent-chat-ui/pull/263
Author: @geoffreyp
Created: 4/3/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • 755c5ff feat: 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.

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/agent-chat-ui/pull/263 **Author:** [@geoffreyp](https://github.com/geoffreyp) **Created:** 4/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`755c5ff`](https://github.com/langchain-ai/agent-chat-ui/commit/755c5fffe0292ad25552796c0e17773fe58e18fc) feat: handle generic interrupts with Command(resume=...) to prevent graph restart ### 📊 Changes **1 file changed** (+46 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/components/thread/index.tsx` (+46 -17) </details> ### 📄 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. | 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 | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 16:37:09 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/agent-chat-ui#265