zot/internal
patriceckhart 676b5d7510 fix(tui): restore typewriter streaming for turns after tool use
The first assistant turn always streamed correctly, but any
follow-up assistant text after a tool round-trip popped in all
at once when the turn ended instead of typewriter-streaming.

Two bugs, fixed together:

1) handleEvent had no case for EvAssistantStart. The core emits
   this event at the top of every oneTurn including every
   follow-up, but the tui was ignoring it. So after the first
   EvAssistantMessage fired (for the tool_use message), streamOn
   stayed false, subsequent EvTextDelta events filled i.streaming
   but never made it on-screen because StreamingActive wasn't
   flipped back on. Added case core.EvAssistantStart that resets
   the buffer and sets streamOn=true. Belt-and-suspenders: the
   EvTextDelta case also sets streamOn=true so stray delta
   sequences without a preceding start still render.

2) The belt-and-suspenders guard in redraw() was too aggressive:
   it hid streaming whenever the last transcript message was
   assistant-role, which is always true during a follow-up turn
   (the last message is the assistant tool_use from the previous
   oneTurn). Narrowed to a strict duplicate check: only hide
   streaming when assistantText(lastMsg) == streamingBuffer,
   meaning EvAssistantMessage already promoted this exact text
   into the transcript but the next render tick hasnt flipped
   streamOn off yet. That is the only actual race this guard
   was protecting against.

Added a tiny assistantText helper (concatenate TextBlocks of a
message) to implement the dedupe check. Kept in the same file;
no new package API.
2026-04-20 12:56:31 +02:00
..
agent fix(tui): restore typewriter streaming for turns after tool use 2026-04-20 12:56:31 +02:00
assets assets: refresh zot logo to cleaner pixel-art Z 2026-04-20 12:01:43 +02:00
auth feat(auth,tui): dark login pages + /logout picker 2026-04-19 20:14:22 +02:00
core feat(session): /session fork + /session tree 2026-04-20 11:10:56 +02:00
extproto feat(ext): phase 4 - full-event interception, arg rewrites, /reload-ext 2026-04-19 17:02:04 +02:00
provider perf(anthropic): fix cost double-count, tighten caching, correct catalog 2026-04-19 18:57:18 +02:00
skills perf(prompt): cut system prompt to the bone (410 -> 54 tokens) 2026-04-19 17:39:38 +02:00
tui feat(tui): /telegram connect | disconnect | status 2026-04-20 09:18:04 +02:00