From a22e3448a65dac15c0fb2c4c86c9c2aa4b8ad2c0 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 16:52:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A0=E5=9B=BE=E7=9A=84=20backgroundMode=20?= =?UTF-8?q?/=20screenColor=20=E7=B1=BB=E5=9E=8B=E9=94=99=E6=94=B9=E6=88=90?= =?UTF-8?q?=E3=80=8C=E5=BF=85=E9=A1=BB=E6=98=AF=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BackgroundModeNotText、ScreenColorNotText 只在入参不是字符串时触发,文案却回的是取值白名单,模型会以为类型对了、只是值不对 - 改成与本模块其它 *NotText 变体一致的「必须是字符串」;取值白名单仍由 BackgroundModeUnsupported / ScreenColorMalformed 承担 - 文案字面变化:backgroundMode「必须是 complex 或 flat」→「必须是字符串」;screenColor「必须是 auto 或 #RRGGBB」→「必须是字符串」 验证:cargo fmt --all --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check 通过 --- .../src-tauri/src/agent/tool/remove_background/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/tool/remove_background/error.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/tool/remove_background/error.rs index a04887152..1c903e51a 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/tool/remove_background/error.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/tool/remove_background/error.rs @@ -94,13 +94,13 @@ impl ToolFailure for RemoveBackgroundError { format!("抠图失败:assetName 必须是字符串,当前是「{got}」。") } Self::BackgroundModeNotText { got } => { - format!("抠图失败:backgroundMode 必须是 complex 或 flat,当前是「{got}」。") + format!("抠图失败:backgroundMode 必须是字符串,当前是「{got}」。") } Self::BackgroundModeUnsupported { got } => { format!("抠图失败:backgroundMode「{got}」不受支持,只能是 complex 或 flat。") } Self::ScreenColorNotText { got } => { - format!("抠图失败:screenColor 必须是 auto 或 #RRGGBB,当前是「{got}」。") + format!("抠图失败:screenColor 必须是字符串,当前是「{got}」。") } Self::ScreenColorMalformed { got } => { format!("抠图失败:screenColor「{got}」不是受支持的取值,必须是 auto 或 #RRGGBB。")