fix: multiple Human in the loop approvals getting stuck by jonasHanhan · Pull Request #475 · xerrors/Yuxi

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