Skip to content

bodhi-realtime-agent / TurnState

Type Alias: TurnState ​

TurnState = "active" | "finalized"

Defined in: src/core/turn.ts:16

Turn — the lifecycle entity for one conversational turn.

A Turn owns the framework turn identity and an explicit, idempotent lifecycle: two states (active → finalized) and one terminal transition. finalize() performs the state change once and reports whether the caller was the first; VoiceSession runs side effects only for that first caller, so dedup is structural rather than reconstructed from flags.

A framework Turn is the unit of conversation and may legitimately span more than one transport server turn (e.g. a blocking subagent question sent mid-turn opens a fresh generation underneath it), so it owns a set of server-turn ids rather than one.

Built with VitePress