diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tool_bridge.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tool_bridge.rs index 08c60dcb2..69570ae62 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tool_bridge.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tool_bridge.rs @@ -3635,6 +3635,14 @@ async fn bridge_godot_execute( .await } +/// 编辑器响应给模型前的字符上限:保留原文,只挡住超大 stdout/result。 +#[cfg(all( + windows, + target_arch = "x86_64", + any(feature = "unity-editor-execute", feature = "godot-editor-execute") +))] +const DIRECT_TOOL_BRIDGE_EDITOR_RESPONSE_MAX_CHARS: usize = 32_000; + #[cfg(all( windows, target_arch = "x86_64", @@ -3664,7 +3672,13 @@ async fn bridge_editor_execute( report: response, }); } - Ok(bridge_tool_result(response.to_string(), Vec::new())) + Ok(bridge_tool_result( + crate::agent::redaction::truncate_agent_runtime_text( + &response.to_string(), + DIRECT_TOOL_BRIDGE_EDITOR_RESPONSE_MAX_CHARS, + ), + Vec::new(), + )) } Ok(Err(error)) => Err(error), Err(_) => Err(EditorExecuteError::ExecutionUnconfirmed { editor }),