From 6df7a6403d88a4492ab6ea1c519dcae3a202be96 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 18 Nov 2026 12:01:38 +0100 Subject: 0.9.0: distinguishable tool errors, separated stderr, configurable limits From a field report porting a Neovim config to Helix: - validate() now separates 'empty value', 'wrong key (here is what you sent)' and 'no arguments at all, retry' instead of one false message for all four causes - named calls with no arguments are answered rather than dropped silently - bash keeps stdout and stderr in labelled sections when both produce output - bash gains timeout_seconds (1-600) and max_bytes, and says when output was cut - tool lines/results carry [step.call] labels when a step has several calls - invalid JSON errors include a preview of what arrived --- src/ui.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/ui.rs') diff --git a/src/ui.rs b/src/ui.rs index 03e8dbe..fe0264b 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -109,7 +109,7 @@ impl Sink for Renderer { } } -pub fn tool_line(step: usize, name: &str, args: &serde_json::Value, include_detail: bool) { +pub fn tool_line(label: &str, name: &str, args: &serde_json::Value, include_detail: bool) { let detail = match name { "bash" => args .get("cmd") @@ -132,7 +132,7 @@ pub fn tool_line(step: usize, name: &str, args: &serde_json::Value, include_deta .unwrap_or("") .to_string(), }; - let head = paint("1;36", &format!("● [{step}] {name}")); + let head = paint("1;36", &format!("● [{label}] {name}")); if include_detail && !detail.is_empty() { println!("{head} {detail}"); } else { @@ -141,13 +141,18 @@ pub fn tool_line(step: usize, name: &str, args: &serde_json::Value, include_deta let _ = std::io::stdout().flush(); } -pub fn tool_result(summary: &str, aborted: bool) { +pub fn tool_result(label: &str, summary: &str, aborted: bool) { let text = if aborted { "aborted".to_string() } else { crate::provider::truncate(summary.trim(), 100) }; - println!(" {} {}", paint("2", "└"), paint("2", &text)); + println!( + " {} {} {}", + paint("2", &format!("[{label}] └")), + paint("2", &text), + "" + ); let _ = std::io::stdout().flush(); } -- cgit v1.2.3