How to force an Agent Loop to wait for User Input (Human-in-the-Loop)

I’m building a classification system with a multi-agent architecture, but I’m struggling with execution flow. Here is my setup:

  1. Sequential Parent Agent: This manages the overall flow.

  2. Validation Loop (Agent 1): A Loop Agent (max 5 iterations) containing two sub-agents:

    • Sub-Agent A: Collects query/info from the user.

    • Sub-Agent B: Validates if the query has enough info for classification.

  3. Classification Agent (Agent 2): Processes the validated data.

The Problem: When I run the system, the Validation Loop executes all 5 iterations instantly. Instead of pausing for me to provide missing info, it cycles through the sub-agents internally and finishes before I can interact.

The Goal: If Sub-Agent B finds the info is invalid, the loop should pause and prompt me (the user) for input. If it’s valid, it should break the loop and move to the Classification Agent.

Has anyone successfully implemented a “pause-and-wait” mechanism inside a loop agent?

Below is the link to code: (URL Removed by Staff)