You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
claudbg/.beans/claudbg-kg0v--tool-use-inpu...

55 lines
1.6 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
# claudbg-kg0v
title: Tool use input truncated at 120 chars regardless of --verbose
status: completed
type: bug
priority: normal
created_at: 2026-03-30T04:44:31Z
updated_at: 2026-03-30T05:13:37Z
parent: claudbg-8vpb
---
## Problem
Tool use input (arguments passed to a tool) is hard-capped at 120 characters in transcriptions, cutting off commands mid-content:
```
[tool: Bash] {"command":"nix develop --command bash -c \"./target/debug/claudbg --help && echo '===' && ./target/debug/claudbg sessio
```
## Expected behavior
- Default: truncate at 120 chars (or a slightly higher value like 200) with a `…` indicator.
- `--verbose`: show full input, no truncation.
## Current behavior
Both `render_entry_text` implementations use a hardcoded 120-char cap regardless of `opts.verbose`:
```rust
// src/commands/sessions.rs:108-110
let input_preview = serde_json::to_string(input).unwrap_or_default();
let boundary = input_preview.floor_char_boundary(120);
let input_short = &input_preview[..boundary];
```
The `opts.verbose` flag is checked nowhere in the tool use branch.
## Fix
```rust
let cap = if opts.verbose { usize::MAX } else { 120 };
let boundary = input_preview.floor_char_boundary(cap);
```
Same change needed in `agents.rs`.
## Relevant files
- `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.