Skip to content

fix: multiple Human in the loop approvals getting stuck#475

Merged
xerrors merged 1 commit intoxerrors:mainfrom
jonasHanhan:fix-issue-453
Jan 15, 2026
Merged

fix: multiple Human in the loop approvals getting stuck#475
xerrors merged 1 commit intoxerrors:mainfrom
jonasHanhan:fix-issue-453

Conversation

@jonasHanhan
Copy link
Contributor

Description

Fix issue #453: When multiple Human in the loop tool calls occur in a single conversation, the second call gets stuck.

Change Type

  • New Feature
  • Bug Fix
  • Documentation Update
  • Other

Root Cause

  • The main chat flow (stream_agent_chat) checks for pending interrupts after streaming ends by calling check_and_handle_interrupts
  • However, the resume flow (resume_agent_chat) was missing this check
  • When a new interrupt() was triggered after resume, the frontend never received the new human_approval_required message, causing the conversation to appear stuck

Fix

Added check_and_handle_interrupts call to resume_agent_chat function after stream ends, making it consistent with the main chat flow.

Testing

  • Tested in Docker environment
  • Related functionality works correctly

Related Issue

Closes #453

Add check_and_handle_interrupts call to resume_agent_chat function
to make it consistent with the main chat flow.

Root cause:
- Main chat flow checks for pending interrupts after stream ends
- Resume flow was missing this check
- When a new interrupt was triggered after resume, frontend never
  received the new approval request

Fix:
- Add the same interrupt detection logic after stream ends in resume flow
@xerrors
Copy link
Owner

xerrors commented Jan 15, 2026

感谢 PR!

@xerrors xerrors merged commit e63d09d into xerrors:main Jan 15, 2026
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.

Error: 智能体在多次使用Human in the loop工具审核时,会卡住不动

2 participants