fix: hide internal tool-result file reads from sidebar activity

Claude reads its own ~/.claude/projects/.../tool-results/ files as
internal plumbing. These showed up as long unreadable paths in the
sidebar. Now: describeToolCall returns empty for tool-result reads,
and the sidebar skips rendering tool_use entries with no description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-04 07:56:16 -07:00
parent 907d9d0187
commit e3be644b45
2 changed files with 11 additions and 3 deletions
+6 -2
View File
@@ -241,11 +241,15 @@ function handleAgentEvent(entry) {
if (thinking) thinking.remove();
if (entry.type === 'tool_use') {
const toolEl = document.createElement('div');
toolEl.className = 'agent-tool';
const toolName = entry.tool || 'Tool';
const toolInput = entry.input || '';
// Skip tool uses with no description (e.g. internal tool-result file reads)
if (!toolInput) return;
const toolEl = document.createElement('div');
toolEl.className = 'agent-tool';
// Use the verbose description as the primary text
// The tool name becomes a subtle badge
const toolIcon = toolName === 'Bash' ? '▸' : toolName === 'Read' ? '📄' : toolName === 'Grep' ? '🔍' : toolName === 'Glob' ? '📁' : '⚡';