Skip to content

Commit 27f8140

Browse files
tarekziadeclaude
andcommitted
web UI: collapse tool-result chat lines to a single line + size hint
read_file / grep results dumped their (often large) content into the live stream, which was hard to follow. Show just `tool ⟵ <name> (N lines)`; the full truncated result stays in stored history for debugging. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 58f0f5f commit 27f8140

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

reviewbot/static/review.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,12 @@
210210
}
211211
if (!m || typeof m !== "object") return text;
212212
if (m.role === "tool") {
213-
const first = String(m.content || "").split("\n")[0].slice(0, 140);
214-
return `tool ⟵ ${m.name || "?"}: ${first}`;
213+
// Don't dump the (often large) tool output into the console; just note
214+
// the tool and a size hint. Full result is in stored history.
215+
const c = String(m.content || "");
216+
const lines = c ? c.split("\n").length : 0;
217+
const size = lines ? ` (${lines} line${lines === 1 ? "" : "s"})` : "";
218+
return `tool ⟵ ${m.name || "?"}${size}`;
215219
}
216220
const meta = [];
217221
if (m.finish_reason != null && m.finish_reason !== "stop") {

reviewbot/static/task.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ <h2 style="margin-top:0;">Task</h2>
114114
try { m = JSON.parse(txt); } catch (_) { return txt; }
115115
if (!m || typeof m !== "object") return txt;
116116
if (m.role === "tool") {
117-
const first = String(m.content || "").split("\n")[0].slice(0, 140);
118-
return `tool ⟵ ${m.name || "?"}: ${first}`;
117+
// Don't dump the (often large) tool output into the console; just
118+
// note the tool and a size hint. Full result is in stored history.
119+
const c = String(m.content || "");
120+
const lines = c ? c.split("\n").length : 0;
121+
const size = lines ? ` (${lines} line${lines === 1 ? "" : "s"})` : "";
122+
return `tool ⟵ ${m.name || "?"}${size}`;
119123
}
120124
const meta = [];
121125
if (m.finish_reason != null && m.finish_reason !== "stop") meta.push(`finish=${m.finish_reason}`);

0 commit comments

Comments
 (0)