Compact single-line tool output for file operations and shell

Implement compact display format for read_file, write_file, str_replace, and shell:

- read_file/write_file/str_replace: Single line with dimmed summary and timing
  Format: ● tool_name | path [range] | summary | tokens ◉ time

- shell: Two-line format with command header and dimmed output
  Format: ● shell | command
          └─ output (N lines) | tokens ◉ time

Changes:
- Add print_tool_compact() method to UiWriter trait
- Add is_shell_compact state tracking in ConsoleUiWriter
- Add format_write_file_summary() and format_str_replace_summary() helpers
- Fix duplicate response output by checking if response is empty before printing
- Add finish_streaming_markdown() call before return to flush markdown buffer
This commit is contained in:
Dhanji R. Prasanna
2026-01-12 14:37:47 +05:30
parent 8d5dd9f84a
commit 2c411c058a
7 changed files with 242 additions and 26 deletions

View File

@@ -49,7 +49,10 @@ pub async fn execute_task_with_retry<W: UiWriter>(
if attempt > 1 {
output.print(&format!("✅ Request succeeded after {} attempts", attempt));
}
output.print_smart(&result.response);
// Only print response if it's not empty (streaming already displayed it)
if !result.response.trim().is_empty() {
output.print_smart(&result.response);
}
return;
}
Err(e) => {