From 4fd09045d0740f638170fc05ed0b4e48587a6cbf Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Sun, 29 Mar 2026 22:13:41 -0700 Subject: [PATCH] fix(transcribe): respect --verbose for tool use input truncation Replace hardcoded 120-char cap with usize::MAX when opts.verbose is set. Also add a trailing ellipsis indicator when content is actually truncated. Closes claudbg-kg0v Co-Authored-By: Claude Sonnet 4.6 --- ...tool-use-input-truncated-at-120-chars-regardless-o.md | 9 +++++++-- src/commands/agents.rs | 6 ++++-- src/commands/sessions.rs | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.beans/claudbg-kg0v--tool-use-input-truncated-at-120-chars-regardless-o.md b/.beans/claudbg-kg0v--tool-use-input-truncated-at-120-chars-regardless-o.md index dfc6f7b..2bd9440 100644 --- a/.beans/claudbg-kg0v--tool-use-input-truncated-at-120-chars-regardless-o.md +++ b/.beans/claudbg-kg0v--tool-use-input-truncated-at-120-chars-regardless-o.md @@ -1,10 +1,11 @@ --- # claudbg-kg0v title: Tool use input truncated at 120 chars regardless of --verbose -status: todo +status: completed type: bug +priority: normal created_at: 2026-03-30T04:44:31Z -updated_at: 2026-03-30T04:44:31Z +updated_at: 2026-03-30T05:13:37Z parent: claudbg-8vpb --- @@ -47,3 +48,7 @@ Same change needed in `agents.rs`. - `src/commands/sessions.rs` — `render_entry_text`, `ToolUse` branch (~lines 107–111) - `src/commands/agents.rs` — `render_entry_text`, `ToolUse` branch (~lines 68–72) + +## Summary of Changes + +In sessions.rs and agents.rs render_entry_text ToolUse branch: replaced hardcoded 120-char cap with cap=usize::MAX when opts.verbose, 120 otherwise. Added ellipsis indicator when content is actually truncated. diff --git a/src/commands/agents.rs b/src/commands/agents.rs index b4012a2..4fd8c8b 100644 --- a/src/commands/agents.rs +++ b/src/commands/agents.rs @@ -67,9 +67,11 @@ fn render_entry_text(entry: &crate::models::session::RawEntry, opts: &crate::cli } crate::models::session::ContentBlock::ToolUse { name, input, .. } => { let input_preview = serde_json::to_string(input).unwrap_or_default(); - let boundary = input_preview.floor_char_boundary(120); + let cap = if opts.verbose { usize::MAX } else { 120 }; + let boundary = input_preview.floor_char_boundary(cap); let input_short = &input_preview[..boundary]; - println!("[tool: {name}] {input_short}"); + let ellipsis = if !opts.verbose && input_preview.len() > 120 { "…" } else { "" }; + println!("[tool: {name}] {input_short}{ellipsis}"); } crate::models::session::ContentBlock::ToolResult { content, is_error, .. diff --git a/src/commands/sessions.rs b/src/commands/sessions.rs index c104144..55038de 100644 --- a/src/commands/sessions.rs +++ b/src/commands/sessions.rs @@ -106,9 +106,11 @@ fn render_entry_text(entry: &crate::models::session::RawEntry, opts: &crate::cli } crate::models::session::ContentBlock::ToolUse { name, input, .. } => { let input_preview = serde_json::to_string(input).unwrap_or_default(); - let boundary = input_preview.floor_char_boundary(120); + let cap = if opts.verbose { usize::MAX } else { 120 }; + let boundary = input_preview.floor_char_boundary(cap); let input_short = &input_preview[..boundary]; - println!("[tool: {name}] {input_short}"); + let ellipsis = if !opts.verbose && input_preview.len() > 120 { "…" } else { "" }; + println!("[tool: {name}] {input_short}{ellipsis}"); } crate::models::session::ContentBlock::ToolResult { content, is_error, ..