From 7767493428f45926c9e477e146b7d28235daad01 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 3 Jun 2026 18:14:52 +0200 Subject: [PATCH] feat(#1161): show full bash commands in terminal as expandable details --- frontend/packages/agent/src/app.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend/packages/agent/src/app.js b/frontend/packages/agent/src/app.js index caca3feb..426e0e92 100644 --- a/frontend/packages/agent/src/app.js +++ b/frontend/packages/agent/src/app.js @@ -1227,7 +1227,10 @@ window.marked = marked; const name = c.name || ''; const input = c.input || {}; const short = name.startsWith('mcp__hyperhive__') - ? name.slice('mcp__hyperhive__'.length) + '*' : name; + ? name.slice('mcp__hyperhive__'.length) + '*' + : name.startsWith('mcp__bash__') + ? name.slice('mcp__bash__'.length) + '*' + : name; switch (name) { case 'Read': return short + ' ' + (input.file_path || ''); case 'Write': return short + ' ' + (input.file_path || ''); @@ -1251,6 +1254,15 @@ window.marked = marked; case 'mcp__hyperhive__kill': return short + ' ' + (input.name || ''); case 'mcp__hyperhive__request_apply_commit': return short + ' ' + (input.agent || '') + ' @ ' + (input.commit_ref || '').slice(0, 12); + case 'mcp__bash__bash_run': { + // Rich renderer handles the full body; this summary covers any + // fallback path and the details summary line. + const firstLine = String(input.cmd || '').split('\n')[0]; + return short + ' $ ' + trim(firstLine.trim(), 72); + } + case 'mcp__bash__bash_status': + return short + ' id:' + (input.id || '?') + + (input.wait_seconds != null ? ' · wait ' + input.wait_seconds + 's' : ''); default: return fmtArgsGeneric(short, input); } } @@ -1339,6 +1351,15 @@ window.marked = marked; 'answer #' + id + (lines > 1 ? ` · ${lines}L` : ''), a); } + // Bash task runner — show full command in an expandable pre block so + // multi-line scripts are readable. Summary uses the first line so the + // row is identifiable without expanding. + if (name === 'mcp__bash__bash_run') { + const cmd = String(input.cmd || ''); + const firstLine = cmd.split('\n')[0]; + const summary = 'bash_run* $ ' + trim(firstLine.trim(), 72); + return api.details('tool-use', summary, '$ ' + cmd); + } return null; } // Track tool_use_id → tool name so we can decide on rendering when the