From 357bf326e04bd8ce10c5b3a30a91c6a7bb097262 Mon Sep 17 00:00:00 2001 From: Jiayuan Zhang Date: Mon, 16 Feb 2026 03:39:11 +0800 Subject: [PATCH] fix(data): propagate errors so is_error is set correctly in run-log Previously the data tool caught all errors and returned them as normal tool results with error info in the JSON content. This meant pi-agent-core never saw an exception and always set isError=false in the run-log, even for rate limit errors (errCode 9001) and other API failures. Now errors propagate to pi-agent-core which sets isError=true and formats the error message for the LLM automatically. Co-Authored-By: Claude Opus 4.6 --- .../core/src/agent/tools/data/data-tool.ts | 40 ++++++------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/packages/core/src/agent/tools/data/data-tool.ts b/packages/core/src/agent/tools/data/data-tool.ts index b4bb2e99..5f3aaf24 100644 --- a/packages/core/src/agent/tools/data/data-tool.ts +++ b/packages/core/src/agent/tools/data/data-tool.ts @@ -83,36 +83,20 @@ export function createDataTool(): AgentTool