|
|
---
|
|
|
# claudbg-f4ot
|
|
|
title: Transcription header shows tools as debug HashMap, not readable list
|
|
|
status: completed
|
|
|
type: bug
|
|
|
priority: normal
|
|
|
created_at: 2026-03-30T04:43:50Z
|
|
|
updated_at: 2026-03-30T05:10:08Z
|
|
|
parent: claudbg-8vpb
|
|
|
---
|
|
|
|
|
|
## Problem
|
|
|
|
|
|
The transcription header line `Tools:` prints a raw Rust debug-format `HashMap`, e.g.:
|
|
|
|
|
|
```
|
|
|
Tools: {"Bash": 3, "Read": 5, "Write": 2}
|
|
|
```
|
|
|
|
|
|
## Expected behavior
|
|
|
|
|
|
A human-readable comma-separated summary, e.g.:
|
|
|
|
|
|
```
|
|
|
Tools: Bash×3, Read×5, Write×2
|
|
|
```
|
|
|
|
|
|
(or similar format — `Name(n)`, `Name: n`, etc. — sorted by count descending)
|
|
|
|
|
|
## Root cause
|
|
|
|
|
|
`src/commands/sessions.rs:427`:
|
|
|
```rust
|
|
|
println!("Tools: {:?}", stats.tool_calls);
|
|
|
```
|
|
|
|
|
|
`stats.tool_calls` is `HashMap<String, u64>`. The `:?` debug format is not user-friendly.
|
|
|
|
|
|
Same issue exists in `src/commands/agents.rs` transcribe header (prints same stats).
|
|
|
|
|
|
## Fix
|
|
|
|
|
|
Format `stats.tool_calls` by iterating entries, sorting by count descending, and joining as `"Name×N"`. The `×` (multiplication sign) or `(N)` notation both work.
|
|
|
|
|
|
## Relevant files
|
|
|
|
|
|
- `src/commands/sessions.rs` — transcribe function, `Tools:` println
|
|
|
- `src/commands/agents.rs` — transcribe function (same issue)
|
|
|
- `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 ', '.
|