tui: terminal tool-call renderer (action-aware) (Etap 3)
...
terminal tool_call results used to fall through to the generic
ToolResultRenderer (flat Text, no awareness of the action). Add an
action-aware renderer registered before the generic one, mirroring filesystem:
- run: command echoed as a shell prompt + dim output + an exit-code anchor
(green on 0, red otherwise). A failed run still shows what ran and the exit
code, not just the raw error.
- open: terminal name (accent) + description + background flag + pid.
- list / status: dim, truncated (200-line cap like the generic tool renderer).
- send_input / close: dim echo. open failure surfaces the reason (already
exists / max reached). Other action failures show the message in red.
Registered before ToolResultRenderer in default_registry (first accepting
renderer wins). ChatPanel._item_msg already spreads the WS payload into meta,
so the renderer reads args/result/success/metadata directly.
Tests: accepts gating, run success/failure with exit code, open name/desc/pid,
list/status/send_input/close, run truncation; render_plain covers the
borderless reading-mode path. Full suite: 982 passed, 1 skipped.
Plan: docs/terminal_tool_plan.md — Etap 3 of 5.
Eugene Sukhodolskiy
committed
on 13 Jul