Skip to content

fix: resolve voice 1007 disconnect#66

Merged
jeffgreendesign merged 1 commit intomainfrom
claude/fix-voice-1007-disconnect
Apr 5, 2026
Merged

fix: resolve voice 1007 disconnect#66
jeffgreendesign merged 1 commit intomainfrom
claude/fix-voice-1007-disconnect

Conversation

@jeffgreendesign
Copy link
Copy Markdown
Owner

Summary

  • Replace sendClientContent({ turnComplete: true }) with sendRealtimeInput({ text: " " }) to trigger the model's initial greeting
  • The Gemini Live API rejects mixing sendClientContent with sendRealtimeInput — they're different input modes, and audio was already flowing via sendRealtimeInput when the clientContent message arrived, causing an immediate WebSocket close with code 1007 "Request contains an invalid argument"

Test plan

  • Deploy to Vercel preview
  • Log in, go to dashboard, click voice button
  • Verify voice connects and model greets (no 1007 disconnect)
  • Test in both workspace and chat modes
  • Verify no console errors related to WebSocket state

…eting

Replace sendClientContent({ turnComplete: true }) with
sendRealtimeInput({ text: " " }) to trigger the model's initial
greeting. The Gemini Live API rejects mixing sendClientContent with
sendRealtimeInput — they're different input modes, and audio was already
flowing via sendRealtimeInput when the clientContent message arrived.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commerce-changeset Ready Ready Preview, Comment Apr 5, 2026 7:18pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 77a9a71c-f45d-49d0-bf4b-fd784223610a

📥 Commits

Reviewing files that changed from the base of the PR and between 4bee779 and 356390d.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • lib/hooks/use-gemini-live.ts

Walkthrough

This pull request fixes a voice session connectivity issue where sessions were immediately disconnecting with WebSocket error 1007. The fix modifies the greeting trigger in the Gemini Live hook to use sendRealtimeInput({ text: " " }) instead of sendClientContent({ turnComplete: true }). This change prevents conflicts between input modes when audio is flowing concurrently through sendRealtimeInput. The try/catch error handling remains intact, and inline comments were updated to clarify the purpose of the method change and the error prevention mechanism.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: resolving a WebSocket 1007 disconnect issue in voice functionality, which directly relates to the changeset.
Description check ✅ Passed The description is well-related to the changeset, explaining the technical issue, the solution, and providing a concrete test plan.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-voice-1007-disconnect

Comment @coderabbitai help to get the list of available commands and usage tips.

@jeffgreendesign jeffgreendesign merged commit c5e9fe6 into main Apr 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant