diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e7ddd6..91ef031 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file. ### Fixes +- Fix voice session immediately disconnecting with WebSocket 1007 by replacing `sendClientContent` with `sendRealtimeInput` to avoid mixing input modes - Fix workspace intent bar erroring on simple questions / read-only queries instead of showing response text - Fix bottom bar button/input height mismatch on desktop (Send and Mic buttons now match input height at sm+ breakpoint) - Fix missing voice and visual feedback after changeset execution via voice approval (PR `#29`) diff --git a/lib/hooks/use-gemini-live.ts b/lib/hooks/use-gemini-live.ts index 77103d2..c2f116d 100644 --- a/lib/hooks/use-gemini-live.ts +++ b/lib/hooks/use-gemini-live.ts @@ -600,11 +600,11 @@ export function useGeminiLive( }; // Trigger the model's initial greeting from the system instruction. - // Placed after audio pipeline is wired so mic audio is already flowing - // when the model starts responding. Wrapped in try-catch so a failure - // doesn't tear down the session (model will respond to audio instead). + // Uses sendRealtimeInput (same mode as audio) to avoid mixing with + // sendClientContent, which causes 1007 "invalid argument" when audio + // is also flowing via sendRealtimeInput. try { - primarySession.sendClientContent({ turnComplete: true }); + primarySession.sendRealtimeInput({ text: " " }); } catch { // Non-critical — model will respond once it receives audio input }