agentscope-ai / agentscope-ai/agentscope-java
[BUG]: SubAgent registered as Tool fails when inner Tool call is blocked by Human-in-the-Loop
- Linguagem predominante
- Java
- Estrelas
- 5.6k
- Forks
- 1.3k
- Merge médio
- 4d 12h
- PRs com merge (30d)
- 77
Descrição
## Background
In the usage mode of Agent as Tool, we register a Subagent as the tool, which is called by the main Agent.
During the execution of Subagents, other tools may continue to be called internally, some of which have enabled the Human in the Loop (HITL) mechanism for manual confirmation or intervention at critical steps.
## Problem Description
When a SubAgent is invoked as a Tool:
- The SubAgent internally calls another Tool that has Human-in-the-Loop (HITL) enabled.
- That Tool enters a blocked / pending state while waiting for human intervention.
At this point, the SubAgent’s Tool invocation fails immediately, instead of entering a waiting or recoverable state.
## Expected Behavior
Ideally, the execution flow should be as follows:
1. The Main Agent invokes the SubAgent (as a Tool).
2. The SubAgent internally calls another Tool.
3. That Tool enters a blocked / pending state due to the Human-in-the-Loop mechanism.
4. The system waits for human intervention.
5. The human chooses one of the following actions:
- Continue execution → the Tool completes successfully, and the SubAgent continues execution.
- Cancel execution → the Tool returns a controlled cancellation result, and the SubAgent exits or rolls back gracefully.
The SubAgent returns its final result to the Main Agent.
In other words, Human-in-the-Loop should pause the SubAgent execution chain, not cause it to fail.
## Actual Behavior
The current behavior is:
- Once a Tool inside the SubAgent triggers a Human-in-the-Loop blocking state,
- The SubAgent’s Tool invocation fails immediately.
- The Main Agent receives a failed Tool call result.
- There is no way to:
- wait for human intervention, or
- resume or cancel execution after the human decision.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.