Aborts every delegated run currently in flight for this session (and drops pending narration). This is the
EXPLICIT cancel — on a phone it backs the cancel_pending_work tool — and is deliberately NOT what a
barge-in does (see CancelPendingNarration). Returns how many were aborted (0 when nothing was
running; never throws).
Drops any queued spoken progress update without touching the delegated work — what a barge-in does. The caller took the floor, so a pending "still working on it" is stale, but the jobs they asked for keep running. Never throws.
OptionalCoThe MJ: AI Agent Runs row id created for this voice session (delegated runs nest under it).
Writes the session's last usage, then finalizes the co-agent + prompt run; usage reported afterwards is not
stored. Closing the session runs it after the model session closed, so what the session reports while closing
is kept; calling it before Close() would drop that report. Idempotent, so every teardown path may call it: it
runs once, and every call returns the first call's promise and resolves only once the runs are finalized. The
first call decides the outcome: its success and errorMessage stand.
The session's Close() finalizes with success true, so a host whose bridge start failed calls
Finalize(false, error) BEFORE it closes the session: the run, its prompt run and its step then read Failed
with the start's error, and the close finalizes nothing more.
true → Completed, false → Failed.
OptionalerrorMessage: stringWhy the session failed, stamped on the failed run, prompt run and step. Ignored on success.
OptionalPromptThe MJ: AI Prompt Runs row id for the session's system prompt.
Installs (or clears, with undefined) the host's local tool handler. A tool call whose name the handler
BridgeLocalToolHandler.Handles is executed by the host instead of the shared delegation path.
Whether the agent watches LiveKit meetings (realtime.video.watchMeetings in its effective configuration, which
includes the voiced agent's own). The room coordinator reads it, with whether the session takes video, to decide
whether the bot reads the cameras and screens people allow.
The runtime handle returned by RealtimeClientSessionService.WireBridgeRealtimeSession — the server long-lived (bridged) counterpart to what
PrepareClientSessionreturns for the browser. The bridge holds this for the life of the session: the observability run ids (for nesting + correlation) and an idempotent Finalize that keeps the co-agent run + prompt run from dangling inRunning. It runs when the session'sClose()is invoked, once the model session has closed, and when the connection drops; whichever comes first runs it, and a later call waits for that run.