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 <noreply@anthropic.com>
main
Elijah Voigt 2 months ago
parent 1455859825
commit 4fd09045d0

@ -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 107111)
- `src/commands/agents.rs``render_entry_text`, `ToolUse` branch (~lines 6872)
## 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.

@ -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, ..

@ -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, ..

Loading…
Cancel
Save