zot/internal/agent
patriceckhart ebc5dad18c fix(rpc): wait for in-flight commands on stdin close, drop dup events
three real issues found by actually running zot rpc end-to-end:

1. piping a single command into the process and letting stdin close
   would race the agent loop against the process exit, swallowing
   the entire prompt response. fix: track in-flight prompt and
   compact goroutines in a sync.WaitGroup; run() now waits on it
   before returning.

2. each prompt emitted two consecutive done frames - one from the
   agent loop EvDone passing through EventToJSON, one added at the
   end of runPrompt. suppress EvDone in the prompt sink so only the
   explicit terminator remains.

3. cancelling a turn produced a spurious error frame on top of the
   turn_end stop=aborted that already carried the cancellation.
   suppress error frames when the underlying error is
   context.Canceled, in both prompt and compact paths.

verified manually: ping, get_state, get_models, set_model
(valid + invalid id), clear + get_messages, abort, malformed json,
unknown command, auth gate (missing/wrong/correct token),
stdin-close-while-prompt-running, in-process SDK Prompt, plus all
four reference clients parse cleanly and shell + python actually
drive the protocol.
2026-04-19 12:35:13 +02:00
..
modes feat: zotcore SDK + zot rpc subprocess protocol 2026-04-19 12:26:48 +02:00
tools initial commit 2026-04-17 20:36:38 +02:00
args.go feat: zotcore SDK + zot rpc subprocess protocol 2026-04-19 12:26:48 +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 initial commit 2026-04-17 20:36:38 +02:00
cli.go feat: zotcore SDK + zot rpc subprocess protocol 2026-04-19 12:26:48 +02:00
config.go add telegram bot bridge 2026-04-18 09:15:46 +02:00
modelsync.go initial commit 2026-04-17 20:36:38 +02:00
rpc.go fix(rpc): wait for in-flight commands on stdin close, drop dup events 2026-04-19 12:35:13 +02:00
systemprompt.go initial commit 2026-04-17 20:36:38 +02:00
update.go tui: show 'update available' banner at top of chat 2026-04-18 11:49:22 +02:00