terminal: show recv wait/max params + bash [bg] flag

recv tool-use rows rendered as a bare recv() regardless of args,
hiding whether a turn is parked on a long-poll (wait_seconds) or
draining a burst (max). fmtToolUse now surfaces both. Bash rows
gain a [bg] flag when run_in_background is set.

closes #158
This commit is contained in:
iris 2026-05-21 17:57:24 +02:00
parent 468d682085
commit 4539091f3c
2 changed files with 15 additions and 2 deletions

View file

@ -69,6 +69,10 @@ parent's negative pull.
`renderRichToolUse` (Write/Edit/send/ask/answer get `renderRichToolUse` (Write/Edit/send/ask/answer get
custom renderings); on miss fall through to a flat custom renderings); on miss fall through to a flat
`.tool-use` row with `fmtToolUse → fmtArgsGeneric`. `.tool-use` row with `fmtToolUse → fmtArgsGeneric`.
`fmtToolUse` surfaces the salient arg per built-in tool —
e.g. `recv` shows `wait <N>s` / `max <N>` when set (bare
`recv()` otherwise), `Bash` flags `[bg]` for
`run_in_background` commands.
4. `type == "user"` → walk `message.content[]` for 4. `type == "user"` → walk `message.content[]` for
`tool_result`; `renderToolResult` correlates via `tool_result`; `renderToolResult` correlates via
`tool_use_id → toolNameById` to default-open `recv` `tool_use_id → toolNameById` to default-open `recv`

View file

@ -822,11 +822,20 @@
case 'Edit': return short + ' ' + (input.file_path || ''); case 'Edit': return short + ' ' + (input.file_path || '');
case 'Glob': return short + ' ' + (input.pattern || ''); case 'Glob': return short + ' ' + (input.pattern || '');
case 'Grep': return short + ' ' + (input.pattern || ''); case 'Grep': return short + ' ' + (input.pattern || '');
case 'Bash': return short + ' $ ' + (input.command || ''); case 'Bash': return short + (input.run_in_background ? ' [bg]' : '')
+ ' $ ' + (input.command || '');
case 'TodoWrite': return short + ' (' + ((input.todos || []).length) + ' items)'; case 'TodoWrite': return short + ' (' + ((input.todos || []).length) + ' items)';
case 'mcp__hyperhive__send': return short + ' → ' + (input.to || '?') + ': ' case 'mcp__hyperhive__send': return short + ' → ' + (input.to || '?') + ': '
+ JSON.stringify(input.body || '').slice(0, 80); + JSON.stringify(input.body || '').slice(0, 80);
case 'mcp__hyperhive__recv': return short + '()'; case 'mcp__hyperhive__recv': {
// Surface the long-poll wait + batch size — a bare `recv()` row
// hides whether the agent is parking a turn (wait_seconds) or
// draining a burst (max).
const parts = [];
if (input.wait_seconds != null) parts.push('wait ' + input.wait_seconds + 's');
if (input.max != null) parts.push('max ' + input.max);
return short + (parts.length ? ' ' + parts.join(' · ') : '()');
}
case 'mcp__hyperhive__request_spawn': return short + ' ' + (input.name || ''); case 'mcp__hyperhive__request_spawn': return short + ' ' + (input.name || '');
case 'mcp__hyperhive__kill': return short + ' ' + (input.name || ''); case 'mcp__hyperhive__kill': return short + ' ' + (input.name || '');
case 'mcp__hyperhive__request_apply_commit': case 'mcp__hyperhive__request_apply_commit':