feat: collapsible tool lines in terminal

Long tool messages (e.g. Bash commands) are now stored in full and
displayed collapsed by default, with a toggle button to expand/collapse.
Removes backend truncation of Bash commands at 50 chars.
This commit is contained in:
2026-02-24 10:44:22 -08:00
committed by Naomi Carrigan
parent d2e0915a75
commit 24313facca
2 changed files with 59 additions and 9 deletions
+2 -9
View File
@@ -1689,12 +1689,7 @@ fn format_tool_description(name: &str, input: &serde_json::Value) -> String {
}
"Bash" => {
if let Some(cmd) = input.get("command").and_then(|v| v.as_str()) {
let truncated = if cmd.len() > 50 {
format!("{}...", &cmd[..50])
} else {
cmd.to_string()
};
format!("Running: {}", truncated)
format!("Running: {}", cmd)
} else {
"Running command...".to_string()
}
@@ -1855,9 +1850,7 @@ mod tests {
let long_cmd = "a".repeat(100);
let input = serde_json::json!({"command": long_cmd});
let desc = format_tool_description("Bash", &input);
assert!(desc.starts_with("Running: "));
assert!(desc.ends_with("..."));
assert!(desc.len() < 70);
assert_eq!(desc, format!("Running: {}", long_cmd));
}
#[test]