Mechanism: gemini-3.8-live (BidiGenerateContent WebSocket) acts as the acoustic Fast Talker, while DurableAgent acts as the background Durable Thinker invoked through NON_BLOCKING function declarations (delegate_to_durable_agent, abort_durable_agent). sessionResumptionUpdate.newHandle is persisted in VoiceSessionDoc inside agent.sqlite so goAway resets reconnect transparently.

pnpm exec tsx examples/31-voice-live-dual-brain/run.ts # :7493 + /shell/ with custom:voice-dual-brain
pnpm exec tsx examples/31-voice-live-dual-brain/run.ts --smoke # offline verification, exit 0
# Live Gemini 3.8 Live + DurableAgent (requires GEMINI_API_KEY in .env)
dotenvx run -- pnpm exec tsx examples/31-voice-live-dual-brain/run.ts \
--live --model google:gemini-4-hydrogen
Open http://127.0.0.1:7493/shell/ to inspect the two-lane Voice: Dual-Brain Live panel (voice-dual-brain.js) alongside the shared Chat ledger.
Checks
| Check | What it proves |
|---|---|
talker-streams-audio-and-transcripts | Chitchat streams 24 kHz PCM audio and transcripts directly from the Talker without waking the Durable Thinker. |
non-blocking-delegation-with-filler | Task prompts emit a NON_BLOCKING delegate_to_durable_agent call and speak a conversational filler before DurableAgent finishes, then speak the grounded tool result. |
session-resumption-persists-across-goaway | sessionResumptionUpdate stores the handle in VoiceSessionDoc, and simulate_goaway reconnects carrying that exact handle. |
barge-in-interrupts-both-brains | Sending barge_in while the Thinker is held interrupts the Talker, calls conv.abort(), and increments VoiceSessionDoc.bargeIns. |
substrate-component-served | /shell/manifest.json includes custom:voice-dual-brain and /shell/custom/voice-dual-brain.js returns 200. |
Break it
In examples/31-voice-live-dual-brain/run.ts, stop writing d.resumptionHandle = handle inside onResumptionHandle. On simulate_goaway, reconnected.event.resumedFrom becomes null instead of the saved handle, and session-resumption-persists-across-goaway fails.
Files
run.ts:serveAgent+/api/voice-liveDual-Brain WebSocket bridge (MockGeminiLiveTalker+ liveBidiGenerateContentclient) and--smoke.components/voice-dual-brain.js: Two-lane Substrate Shell inspector withAudioWorkletcapture & playback.PROMPT.md: Prompt to rebuild this lab.