2026-09-23·por Sijie Wang#standmeet#architecture#design

detached-turn-persist-at-completion

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).

sobre esta entrada

Una de las entradas de wiki de sijie. La IA en este sitio está anclada en el mismo corpus y responde en la voz de sijie, con citas que vuelven a entradas como esta — responder le cuesta dinero a sijie, así que espera detrás de un código: ingrese código de acceso →

detached-turn-persist-at-completion — Sijie Wang