Skip to content

Commit e63d09d

Browse files
authored
Merge pull request #475 from jonasHanhan/fix-issue-453
fix: multiple Human in the loop approvals getting stuck
2 parents 339cd0f + 3a75b75 commit e63d09d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/routers/chat_router.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,11 +798,17 @@ def make_resume_chunk(content=None, **kwargs):
798798
content=getattr(msg, "content", ""), msg=msg_dict, metadata=metadata, status="loading"
799799
)
800800

801+
# Check for new interrupts (support multiple human in the loop)
802+
langgraph_config = {"configurable": input_context}
803+
async for chunk in check_and_handle_interrupts(
804+
agent, langgraph_config, make_resume_chunk, meta, thread_id
805+
):
806+
yield chunk
807+
801808
meta["time_cost"] = asyncio.get_event_loop().time() - start_time
802809
yield make_resume_chunk(status="finished", meta=meta)
803810

804811
# 保存消息到数据库
805-
langgraph_config = {"configurable": input_context}
806812
conv_manager = ConversationManager(db)
807813
await save_messages_from_langgraph_state(
808814
agent_instance=agent,

0 commit comments

Comments
 (0)