zot/internal/agent
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
..
extensions feat(ext): phase 4 - full-event interception, arg rewrites, /reload-ext 2026-04-19 17:02:04 +02:00
modes fix(tui): restore typewriter streaming for turns after tool use 2026-04-20 12:56:31 +02:00
tools feat(tui,bash): shell-log style bash results 2026-04-20 09:03:24 +02:00
args.go fix(no-yolo): don't auto-refuse tool calls in non-interactive modes 2026-04-19 19:17:05 +02:00
botcmd.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_unix.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_windows.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
build.go rename: /lock -> /jail, /unlock -> /unjail 2026-04-20 08:57:40 +02:00
changelog.go feat(tui): show github release notes once after upgrading 2026-04-19 16:12:13 +02:00
cli.go fix(session): export the full running conversation, handle quoted paths 2026-04-20 10:19:53 +02:00
config.go feat(tui): show github release notes once after upgrading 2026-04-19 16:12:13 +02:00
extcmd.go feat: extension system (subprocess + json-rpc, any language) 2026-04-19 14:09:43 +02:00
modelsync.go initial commit 2026-04-17 20:36:38 +02:00
rpc.go fix(no-yolo): don't auto-refuse tool calls in non-interactive modes 2026-04-19 19:17:05 +02:00
systemprompt.go feat(auth,tui): dark login pages + /logout picker 2026-04-19 20:14:22 +02:00
update.go tui: show 'update available' banner at top of chat 2026-04-18 11:49:22 +02:00