Problem
In media/chat-tools.js, the argsPreview() function dumps the entire serialized arguments object into the tool card header:
function argsPreview(args) {
try {
return JSON.stringify(args);
} catch {
return String(args);
}
}
When the agent calls write_file or edit_file with a large file body, or bash with a long script, the one-line preview in the collapsed card header becomes hundreds of characters — the tool name is pushed off-screen and the preview is meaningless.
Steps to reproduce / context
- Ask CodeLoop to write a file with more than ~50 lines.
- Watch the
write_file tool card — the header overflows with the full file content serialized as JSON.
Expected behavior
The args preview in the header (collapsed state) should be truncated to a short summary (e.g. 80 characters) with an ellipsis. The full JSON is already visible in the expanded card body (argsPre), so no information is lost.
Suggested fix
const MAX_PREVIEW = 80;
function argsPreview(args) {
try {
const s = JSON.stringify(args);
return s.length > MAX_PREVIEW ? s.slice(0, MAX_PREVIEW) + "…" : s;
} catch {
return String(args).slice(0, MAX_PREVIEW);
}
}
Problem
In
media/chat-tools.js, theargsPreview()function dumps the entire serialized arguments object into the tool card header:When the agent calls
write_fileoredit_filewith a large file body, orbashwith a long script, the one-line preview in the collapsed card header becomes hundreds of characters — the tool name is pushed off-screen and the preview is meaningless.Steps to reproduce / context
write_filetool card — the header overflows with the full file content serialized as JSON.Expected behavior
The args preview in the header (collapsed state) should be truncated to a short summary (e.g. 80 characters) with an ellipsis. The full JSON is already visible in the expanded card body (
argsPre), so no information is lost.Suggested fix