fix(transcribe): format tool_calls as readable list in header

Replace {:?} debug format with entries sorted by count descending,
formatted as "Name×N" joined by ", " instead of raw HashMap output.

Closes claudbg-f4ot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Elijah Voigt 2 months ago
parent 123913aefd
commit dbffc151fb

@ -1,10 +1,11 @@
--- ---
# claudbg-f4ot # claudbg-f4ot
title: Transcription header shows tools as debug HashMap, not readable list title: Transcription header shows tools as debug HashMap, not readable list
status: todo status: completed
type: bug type: bug
priority: normal
created_at: 2026-03-30T04:43:50Z created_at: 2026-03-30T04:43:50Z
updated_at: 2026-03-30T04:43:50Z updated_at: 2026-03-30T05:10:08Z
parent: claudbg-8vpb parent: claudbg-8vpb
--- ---
@ -46,3 +47,7 @@ Format `stats.tool_calls` by iterating entries, sorting by count descending, and
- `src/commands/sessions.rs` — transcribe function, `Tools:` println - `src/commands/sessions.rs` — transcribe function, `Tools:` println
- `src/commands/agents.rs` — transcribe function (same issue) - `src/commands/agents.rs` — transcribe function (same issue)
- `src/models/stats.rs``tool_calls: HashMap<String, u64>` - `src/models/stats.rs``tool_calls: HashMap<String, u64>`
## Summary of Changes
In sessions.rs transcribe function, replaced {:?} debug format with a sorted, human-readable format: entries sorted by count descending, formatted as 'Name×N', joined by ', '.

@ -513,7 +513,13 @@ pub async fn transcribe(id: &str, follow: bool, opts: &crate::cli::GlobalOpts) -
stats.cache_read_tokens, stats.cache_read_tokens,
stats.cache_creation_tokens stats.cache_creation_tokens
); );
println!("Tools: {:?}", stats.tool_calls); let mut tool_entries: Vec<(&String, &u64)> = stats.tool_calls.iter().collect();
tool_entries.sort_by(|a, b| b.1.cmp(a.1).then(a.0.cmp(b.0)));
let tools_str: Vec<String> = tool_entries
.iter()
.map(|(name, count)| format!("{}×{}", name, count))
.collect();
println!("Tools: {}", tools_str.join(", "));
println!("Duration: {}ms", stats.duration_ms); println!("Duration: {}ms", stats.duration_ms);
println!("{}", "─".repeat(80)); println!("{}", "─".repeat(80));

Loading…
Cancel
Save