agentscope-ai / agentscope-ai/agentscope-java

[BUG]: SubAgent registered as Tool fails when inner Tool call is blocked by Human-in-the-Loop

未關閉
#459 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area/core/agent bug
主要語言
Java
星號
5.6k
分支
1.3k
平均合併
4 天 12 小時
30 天內合併 PR
77

描述

## 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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。