From 3c20d05eb80822489a848defeed4b9aa5eb3f3d9 Mon Sep 17 00:00:00 2001 From: xichaodong <1768205721@qq.com> Date: Wed, 8 Apr 2026 20:31:34 +0800 Subject: [PATCH] refactor(core): remove redundant hasPendingToolUse check in doCall The check at line 275 is always true because the early return at line 268 already guarantees pendingIds is non-empty at that point. Simplify to call acting(0) directly. --- .../src/main/java/io/agentscope/core/ReActAgent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agentscope-core/src/main/java/io/agentscope/core/ReActAgent.java b/agentscope-core/src/main/java/io/agentscope/core/ReActAgent.java index 266c3fd8b..faa00d50d 100644 --- a/agentscope-core/src/main/java/io/agentscope/core/ReActAgent.java +++ b/agentscope-core/src/main/java/io/agentscope/core/ReActAgent.java @@ -272,7 +272,7 @@ protected Mono doCall(List msgs) { // Has pending tools but no input -> resume (execute pending tools directly) if (msgs == null || msgs.isEmpty()) { - return hasPendingToolUse() ? acting(0) : executeIteration(0); + return acting(0); } // Has pending tools + input -> check if user provided tool results