2026-09-23·作者 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).

关于这一条

sijie 的一条 wiki 条目。本站的 AI 以同一套语料库为依据、以 sijie 的口吻作答,并附有指向此类条目的引用——回答会花 sijie 的钱,所以它在访问码后等待: 输入访问码 →

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