Google Antigravity: Thinker-Talker voice tunnel, 20 ms ramp barge-in and spokenChars
Inside Antigravity 2.29.0’s /voice/ws & /voice/tunnel Thinker-Talker architecture, wire-decoded voice.proto, 20 ms ramp barge-in, and spokenChars playhead math.
- 16 kHz boxcar capture -> /voice/ws
- Talker stream <-> /voice/tunnel RPCs
- 20 ms ramp barge-in + spokenChars
Investigation question
How does Google Antigravity bridge a low-latency Gemini Live voice "Talker" to its local Go language_server Cascade "Thinker", avoid audio clicks on barge-in, and truncate transcripts to the exact syllable the user actually heard?
Observed
Static inspection of Antigravity.app (com.google.antigravity v2.29.0: Electron app.asar + 170.37 MB arm64 Go 1.28 language_server Mach-O embedding a 548-entry web archive at byte offset [142007432 : 147635095]) and wire decoding of the embedded @bufbuild/protobuf codegenv2 FileDescriptorProto for third_party/jetski/remote_agent_proxy_pb/voice.proto (exa.remote_agent_proxy_pb) exposes the complete jetski_thinker_talker_v2 voice architecture. Instead of forcing one heavyweight coding agent to synthesize raw audio directly, Antigravity runs a fast Gemini Live Talker (StreamVoice over /voice/ws) coupled to the local Go language_server Cascade Thinker over an in-band reverse-RPC tunnel (/voice/tunnel: LanguageServerCall <-> LanguageServerReply supporting STREAM_AGENT_STATE_UPDATES, SEND_USER_CASCADE_MESSAGE, CANCEL_CASCADE_INVOCATION, HANDLE_CASCADE_USER_INTERACTION, and GET_CASCADE_MODEL_CONFIG_DATA) seeded with SeedHistory and InProgressStep projections (WHEN_IDLE delivery). On the WebAudio DSP path, audio_processor.js (audio-streaming-processor) resamples >16 kHz mic input to 16 kHz via fractional-phase boxcar averaging into exact 640-sample (40 ms) Int16LE frames (voiceIsolation: true, autoGainControl: false, and zero-filled mute frames keeping the server VAD clock warm). Downlink 24 kHz PCM16LE (voice_audio) schedules gaplessly with a 480-sample zero tail; on barge-in (clear_audio), clearWithRamp() executes a 20 ms linear gain ramp to zero before stopping AudioBufferSourceNodes at 25 ms and computes spokenChars = Math.floor(progress * text.length) from hardware AudioContext.currentTime against audio_timing spans.
Inferred
Two subtle voice-agent bugs disappear under this design: (1) hard-stopping an active AudioBufferSourceNode at a non-zero PCM sample creates an audible broadband pop, whereas a 20 ms GainNode linear ramp to zero followed by a 25 ms stop is psychoacoustically instantaneous and click-free; and (2) truncating conversation history at spokenChars derived from the hardware audio clock prevents the model from assuming the user heard sentences that were buffered in WebAudio but interrupted mid-utterance.
Unknown & limitations
Static binary, ASAR, Go symbol, and embedded descriptor analysis only; no live language_server daemon discovery file, CSRF token, user conversation log, or Google Remote Agent Proxy (StreamVoice) backend was accessed. Server-side Gemini Live jetski_thinker_talker_v2 system prompts and cloud VAD parameters remain outside shipped client artifacts.
Architecture
Antigravity’s voice stack spans four tiers: (1) Electron shell (dist/main.js, dist/languageServer.js spawning Go language_server with dynamic port + CSRF token, dist/cablev2.js managing cable_ble_scanner); (2) embedded web client (main.js + audio_processor.js) scheduling 16 kHz capture, 24 kHz playback, and procedural WebAudio connect/disconnect/error/reconnect earcons; (3) local Go language_server (10 voice/*.go units + 141 language_server/voice symbols) serving /voice/ws, /voice/health, /voice/recordings, and /voice/tunnel; and (4) cloud Remote Agent Proxy StreamVoice (jetski_thinker_talker_v2).
Domain & data models
Wire-decoded voice.proto (exa.remote_agent_proxy_pb) defines SessionStatus (STARTING..FAILED with 9 FailureReason enums), VoiceEvent (voice_audio, audio_timing, clear_audio, transcript deltas), SeedHistory + InProgressStep state summaries, MessageDeliveryStrategy (WHEN_IDLE vs immediate), 9 voices x 3 preview samples (arlo, cleo, finn, fola, gero, lora, neno, olin, tari), and reverse-tunnel LanguageServerCall / LanguageServerReply envelopes.
Workflows & state machines
Barge-in and Cascade delegation interlock cleanly: (1) while mic capture streams 40 ms Int16LE frames (sending zero-filled PCM during local mute so server VAD timing never drifts), user interruption triggers server clear_audio; (2) clearWithRamp() ramps playback gain to 0 over 20 ms, stops queued buffers at 25 ms, and slices the assistant’s spoken transcript to spokenChars using AudioContext.currentTime; and (3) when coding action is needed, Talker invokes SEND_USER_CASCADE_MESSAGE or HANDLE_CASCADE_USER_INTERACTION over /voice/tunnel while narrating live STREAM_AGENT_STATE_UPDATES.
API & protocol surfaces
Local Go language_server endpoints (/voice/ws carrying jetski-voice-proto, /voice/tunnel, /voice/health, /voice/recordings), 5 reverse-RPC LanguageServerCall.Method operations (STREAM_AGENT_STATE_UPDATES, SEND_USER_CASCADE_MESSAGE, CANCEL_CASCADE_INVOCATION, HANDLE_CASCADE_USER_INTERACTION, GET_CASCADE_MODEL_CONFIG_DATA), plus separate dictation and narration RPCs.