feat: show elapsed time and context on pending tool spinners
What does this issue track?
When the LLM is generating a tool call (e.g., writing a bash command, preparing a query), the TUI shows a spinner with "Writing command..." but gives no indication of:
- How long it's been waiting
- What the tool is doing
- Whether it's stuck or actually working
This makes it impossible to distinguish between "LLM is thinking" (normal, takes 5-30s) and "something is stuck" (needs intervention).
Proposed improvements
- Elapsed timer on pending spinners — show
⠋ Writing command... 12sso the user knows how long they've been waiting - Partial input preview — as the LLM streams the command, show a truncated preview of what's been generated so far (e.g.,
⠋ Writing command... 12s SELECT o.*, c.name...) - Context line — show which agent/model is generating the response (already shown in footer, but easy to miss)
Why this matters
Data engineering queries can take 30+ seconds for the LLM to compose (complex JOINs, CTEs, window functions). During this time, the user stares at a static spinner with no feedback. This is especially frustrating when:
- The LLM is generating a very long command (bash script, multi-statement SQL)
- Network latency causes slow token streaming
- The user needs to decide whether to interrupt (
esc) or wait
Screenshot
The current experience — no way to know if this is 2 seconds in or 30 seconds in:
~ Writing command...
■ Builder · claude-opus-4-6
Proposed experience
⠋ Writing command... 14s
SELECT o.*, c.name, SUM(li.amount) as total FROM orders o J...
■ Builder · claude-opus-4-6
Scope
This affects all tool types in pending state, not just data tools. The InlineTool component's pending prop is a static string — it could accept a reactive elapsed timer.