Parent: agent-core
The agent turn runs on context.WithoutCancel — a client disconnect (refresh / close) doesn't cancel it; the stream completes and lands in the DB (only a WithTimeout caps it). The event stream is tee'd to a display sink + an accumulator, and the persist hook fires before the done frame — so done means "committed," with no persist-vs-reload race (backend/internal/conversation/inference/agent_turn.go:140, agent_turn_persist.go).
Intentional UX consistency; orthogonal to scaling (see deployment). The only loss is a turn that's mid-generation at a process restart — persistence is one-shot at the end, so that single turn is gone (history is otherwise durable).