Bug Description
In packages/cli/src/ui/hooks/toolMapping.ts, when a tool call errors before its invocation is built, the display description falls back to the raw serialized args:
if (call.status === CoreToolCallStatus.Error) {
description = JSON.stringify(call.request.args);
}
There is no length cap. Tools called with large payloads — write_file with a full file body, execute_code with a long script, MCP tools with structured input — produce descriptions that are hundreds of kilobytes long. This string is rendered as a single line in the tree node row, causing:
- Layout overflow in the task tree and flat tool list
- Excessive re-render cost as Ink tries to measure and wrap the string
- Potential terminal emulator slowdowns from a single massive text node
Fix
Truncate to 120 characters with an ellipsis:
const rawArgs = JSON.stringify(call.request.args);
description = rawArgs.length > 120 ? rawArgs.slice(0, 117) + '...' : rawArgs;
Bug Description
In
packages/cli/src/ui/hooks/toolMapping.ts, when a tool call errors before its invocation is built, the display description falls back to the raw serialized args:There is no length cap. Tools called with large payloads —
write_filewith a full file body,execute_codewith a long script, MCP tools with structured input — produce descriptions that are hundreds of kilobytes long. This string is rendered as a single line in the tree node row, causing:Fix
Truncate to 120 characters with an ellipsis: