From b7d77053ea9ddce960b74834e4813f75802002d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 1 Oct 2026 17:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5=20offset/limit=20=E7=9A=84?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=94=99=E5=9B=9E=E6=98=BE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20not=5Ftext=5Frepr=EF=BC=8C=E4=B8=8E=E5=85=B6=E5=AE=83?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=90=8C=E4=B8=80=E9=99=90=E9=95=BF=E5=8F=A3?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - arguments::page 的 OffsetNotInteger / LimitNotInteger 原来用 value.to_string() 无界回显,超大对象/字符串会整份进错误消息与诊断 - 改用共享的 not_text_repr(120 字符截断),与 optional_text 及内联判类型的字段一致 验证:cargo fmt --check 通过 --- .../src-tauri/src/agent/tool/arguments.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/tool/arguments.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/tool/arguments.rs index fd55ead6d..8618e5644 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/tool/arguments.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/tool/arguments.rs @@ -91,7 +91,7 @@ pub(crate) fn page( .as_u64() .and_then(|value| usize::try_from(value).ok()) .ok_or_else(|| ToolPageRejection::OffsetNotInteger { - got: value.to_string(), + got: not_text_repr(value), }) }) .transpose()? @@ -107,7 +107,7 @@ pub(crate) fn page( .as_u64() .and_then(|value| usize::try_from(value).ok()) .ok_or_else(|| ToolPageRejection::LimitNotInteger { - got: value.to_string(), + got: not_text_repr(value), }) }) .transpose()?