编辑器执行响应给模型前恢复 32k 长度上限
- 新增 DIRECT_TOOL_BRIDGE_EDITOR_RESPONSE_MAX_CHARS=32000 - Unity/Godot 成功回执改为保留原文但按字符数收口
This commit is contained in:
@@ -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 }),
|
||||
|
||||
Reference in New Issue
Block a user