WebSocket 1008 Error "Operation is not implemented" during Function Calling in Live API (gemini-2.5-flash-native-audio-preview-12-2025)

Environment

  • Model:

    gemini-2.5-flash-native-audio-preview-12-2025
    
  • API: Gemini Live API (WebSocket)

  • SDK:

    @google/genai
    

    (npm)

  • Platform: React Native mobile app (iOS/Android)

  • Configuration: Ephemeral tokens with locked tool definitions,

    functionCallingConfig: { mode: 'ANY' }
    

    or

    mode: 'AUTO'
    

Issue Description

I’m experiencing intermittent WebSocket disconnections with close code 1008 when the model attempts to generate a function call. The error message is:

"Operation is not implemented, or supported, or enabled."

The issue occurs specifically when:

  1. User requests an action that requires a function call.

  2. The model begins processing and attempts to generate a function call

  3. The connection is abruptly terminated before the function call is delivered to the client

Debug Information

From WebSocket close event logs:

json

{

“code”: 1008,

“reason”: “Operation is not implemented, or supported, or enabled.”,

“wasClean”: false

}

The last 5 messages received before the drop all show

hasToolCall: false

, indicating the function call never reached the client. The connection is terminated server-side during the generation phase.

What I’ve Verified

  • :white_check_mark: Tool definitions are correctly formatted and locked in the ephemeral token

  • :white_check_mark: Audio format is correct (16-bit PCM, 16kHz, mono)

  • :white_check_mark: Tool responses are properly formatted when sent back

  • :white_check_mark: No client-side errors before disconnection

  • :white_check_mark: Same configuration works successfully on other requests (issue is intermittent)

  • :white_check_mark: Token is valid and not expired

What I’ve Tried

  1. Switched to older model version

    gemini-2.5-flash-native-audio-preview-09-2025
    

    → This model doesn’t follow my instruction very well, specially tool calling. Tested with my ios app development build, the model did not make any tool calls, though claimed that AI made tool calls but no tool calling logs. so not a viable workaround.

  2. Changed function calling mode from

    AUTO
    

    to

    ANY
    

    → Same error occurs

  3. Reduced system instruction size → No improvement

  4. Added client-side error handling and timeout mechanisms → Confirms the issue is server-side

Reproducibility

  • Frequency: Approximately 1 in 5-10 function call attempts

  • Pattern: Can happen anytime, connection instantly drop before tool call even happened (AI announces plan to make a tool call)

  • Workaround: Reconnecting and retrying sometimes works, but user experience is degraded

Expected Behavior

The model should successfully return function calls without terminating the WebSocket connection.

Request

Could the team please investigate this issue? Is there a known limitation with the native audio preview models and function calling in Live API? Are there any recommended workarounds or alternative model versions that have stable function calling support?

Thank you for your help!

3 Likes

This has been very frustrating for us as well. Nothing we’ve tried so far seems to improve the reliability