From 9708ff37776666dc6f0f4ed0e50d3ff46f50c733 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 22:06:01 +0000 Subject: [PATCH] address review: truncate id in batch limit entry --- crates/mcp/src/tools.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index e6c4ae7d0..7e8b309b2 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -375,7 +375,8 @@ pub fn call_tool(b: &mut dyn Backend, name: &str, a: &Value) -> ToolResult { // Failures count too: with keepGoing, a remote backend's large errors add up. used = used.saturating_add(json!(entry.to_string()).to_string().len()); if used > MAX_BATCH_BYTES { - out.push(json!({"command": id, "ok": false, "error": "the batch's results passed 64 MiB; stopped here"})); + let shown: String = id.chars().take(128).collect(); + out.push(json!({"command": shown, "ok": false, "error": "the batch's results passed 64 MiB; stopped here"})); return ToolResult { content: vec![json!({"type": "text", "text": Value::Array(out).to_string()})], is_error: true }; } out.push(entry);