From 91cfb0bc5dd4111639d2571fadb3d1e82aeb4042 Mon Sep 17 00:00:00 2001 From: xinba Date: Thu, 5 Feb 2026 11:09:00 +0800 Subject: [PATCH 1/2] refactor(log): add content info when validate tool paras' schema error Change-Id: Ib2b920ace1e76356737b2915db72e966f9e42a74 --- .../io/agentscope/core/tool/ToolExecutor.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 8e0eb0794..b41a2da39 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 @@ -15,12 +15,6 @@ */ package io.agentscope.core.tool; -import io.agentscope.core.agent.Agent; -import io.agentscope.core.message.ToolResultBlock; -import io.agentscope.core.message.ToolUseBlock; -import io.agentscope.core.model.ExecutionConfig; -import io.agentscope.core.tracing.TracerRegistry; -import io.agentscope.core.util.ExceptionUtils; import java.time.Duration; import java.util.HashMap; import java.util.List; @@ -28,6 +22,13 @@ import java.util.concurrent.ExecutorService; import java.util.function.BiConsumer; import java.util.function.Predicate; + +import io.agentscope.core.agent.Agent; +import io.agentscope.core.message.ToolResultBlock; +import io.agentscope.core.message.ToolUseBlock; +import io.agentscope.core.model.ExecutionConfig; +import io.agentscope.core.tracing.TracerRegistry; +import io.agentscope.core.util.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import reactor.core.publisher.Flux; @@ -148,8 +149,11 @@ private Mono executeCore(ToolCallParam param) { String errorMsg = String.format( "Parameter validation failed for tool '%s': %s\n" + + "Actual content: %s\n" + "Please correct the parameters and try again.", - toolCall.getName(), validationError); + toolCall.getName(), + validationError, + toolCall.getContent()); logger.debug(errorMsg); return Mono.just(ToolResultBlock.error(errorMsg)); } From d4a13870accdebab70f72e5135e8da8428751dff Mon Sep 17 00:00:00 2001 From: xinba Date: Thu, 5 Feb 2026 11:15:39 +0800 Subject: [PATCH 2/2] refactor(log): fix the maven format problem Change-Id: I9ee09aa574c4e9b16f729514fad4d4d00d2cfd88 --- .../io/agentscope/core/tool/ToolExecutor.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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 b41a2da39..7aa04bc33 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 @@ -15,6 +15,12 @@ */ package io.agentscope.core.tool; +import io.agentscope.core.agent.Agent; +import io.agentscope.core.message.ToolResultBlock; +import io.agentscope.core.message.ToolUseBlock; +import io.agentscope.core.model.ExecutionConfig; +import io.agentscope.core.tracing.TracerRegistry; +import io.agentscope.core.util.ExceptionUtils; import java.time.Duration; import java.util.HashMap; import java.util.List; @@ -22,13 +28,6 @@ import java.util.concurrent.ExecutorService; import java.util.function.BiConsumer; import java.util.function.Predicate; - -import io.agentscope.core.agent.Agent; -import io.agentscope.core.message.ToolResultBlock; -import io.agentscope.core.message.ToolUseBlock; -import io.agentscope.core.model.ExecutionConfig; -import io.agentscope.core.tracing.TracerRegistry; -import io.agentscope.core.util.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import reactor.core.publisher.Flux; @@ -151,9 +150,7 @@ private Mono executeCore(ToolCallParam param) { "Parameter validation failed for tool '%s': %s\n" + "Actual content: %s\n" + "Please correct the parameters and try again.", - toolCall.getName(), - validationError, - toolCall.getContent()); + toolCall.getName(), validationError, toolCall.getContent()); logger.debug(errorMsg); return Mono.just(ToolResultBlock.error(errorMsg)); }