agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

[Feature Request] Support returnDirect behavior for ReActAgent tools

Open Alanyaeer opened this issue 3 months ago • 1 comments

Background

In the current ReActAgent flow, after a tool is executed, the agent always performs another reasoning/model call to generate the final response.

Feature Request

I would like to support a returnDirect-like option for tools, similar to Spring AI.

When a tool is configured with this option, ReActAgent should:

  1. Execute the tool.
  2. Return the tool result directly.
  3. Skip the next reasoning/model call.
  4. End the current agent execution.

For example:

@Tool(returnDirect = true)
public String getUserProfile(...) {
    ...
}

This behavior should be configurable per tool, while preserving the current behavior by default for existing tools.

Is there currently a recommended way to achieve this in ReActAgent? If not, could support for this behavior be added?

Alanyaeer avatar Aug 06 '26 12:08 Alanyaeer

重复的 issue,见 https://github.com/agentscope-ai/agentscope-java/issues/1408

xzxiaoshan avatar Aug 26 '26 02:08 xzxiaoshan