diff --git a/agentscope-core/src/main/java/io/agentscope/core/tool/ToolExecutor.java b/agentscope-core/src/main/java/io/agentscope/core/tool/ToolExecutor.java index 5ba4af8f1b..1718561248 100644 --- a/agentscope-core/src/main/java/io/agentscope/core/tool/ToolExecutor.java +++ b/agentscope-core/src/main/java/io/agentscope/core/tool/ToolExecutor.java @@ -336,7 +336,8 @@ private Mono executeWithInfrastructure( logger.warn("Tool call failed: {}", toolCall.getName(), e); String errorMsg = ExceptionUtils.getErrorMessage(e); return Mono.just( - ToolResultBlock.error("Tool execution failed: " + errorMsg)); + ToolResultBlock.error("Tool execution failed: " + errorMsg) + .withIdAndName(toolCall.getId(), toolCall.getName())); }); }