You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
When sending tool responses via sendToolResponse(), the Gemini Live API WebSocket closes with either code 1011 ("Internal error occurred") or code 1008 ("Requested entity was not found"). This happens randomly after tool calls return responses, not consistently.
The error messages are unhelpful. They don't indicate whether the issue is payload size, format, encoding, invalid tool call IDs, or something else, which makes debugging difficult.
I tried making sure tool ids are correct and shortening system prompts and tool responses but issue persists.
Actual vs expected behavior:
Actual:
Tool executes successfully
Tool response is sanitized and formatted
We call sendToolResponse({ functionResponses })
WebSocket closes immediately with code 1011 ("Internal error occurred") or code 1008 ("Requested entity was not found")
No additional error details provided
This happens randomly, not deterministically
Expected:
Tool response is accepted and processed, OR
If rejected, a clear error message explaining why (e.g., "Response too large", "Invalid format", "Encoding error", "Tool call ID not found", etc.)
Description of the bug:
When sending tool responses via
sendToolResponse(), the Gemini Live API WebSocket closes with either code 1011 ("Internal error occurred") or code 1008 ("Requested entity was not found"). This happens randomly after tool calls return responses, not consistently.The error messages are unhelpful. They don't indicate whether the issue is payload size, format, encoding, invalid tool call IDs, or something else, which makes debugging difficult.
I tried making sure tool ids are correct and shortening system prompts and tool responses but issue persists.
Actual vs expected behavior:
Actual:
sendToolResponse({ functionResponses })Expected:
Any other information you'd like to share?
gemini-2.5-flash-native-audio-preview-09-2025responseModalities: [Modality.AUDIO]andoutputAudioTranscription: {}functionDeclarationsTool response format:
We send responses in this structure: