Skip to content

Live: goAway and voiceActivity messages are reported as "Unknown server message" errors #1872

Description

@aparnasharma285

Describe the Bug:

GeminiLlmConnection only translates serverContent, toolCall, usageMetadata, toolCallCancellation and setupComplete. Every other Live server message falls into the catch-all and is emitted as an error response (errorCode = "Unknown server message."). In a normal Live call this happens for two documented message types:

  1. goAway: the server's warning that it is about to close the connection, with timeLeft. ADK drops the payload, so callers can't react (for example by resuming the session) before the connection closes. The call then dies.
  2. voiceActivity (ACTIVITY_START / ACTIVITY_END): when the server reports the user starting or stopping speech, ADK emits an error event.

Both are valid messages in google-genai's LiveServerMessage (goAway(), voiceActivity(), voiceActivityDetectionSignal()), and the SDK parses them correctly. The loss is in ADK. (Separate, known SDK issue: voiceActivity frames that include audioOffset can fail to parse, googleapis/java-genai#1120.)

Cause, in core/src/main/java/com/google/adk/models/GeminiLlmConnection.java: convertToServerResponse has no branch for message.goAway(), voiceActivity() or voiceActivityDetectionSignal(). An unmatched message reaches createUnknownMessageResponse(), which sets errorCode(new FinishReason("Unknown server message.")) and errorMessage("Received unknown server message.") (~line 286 on main). A case-insensitive search of the adk-java tree for goaway finds no handling anywhere.

Steps to Reproduce:

  1. Run a Live (BIDI) session with Runner.runLive(...) against a Gemini Live model, with audio input and StreamingMode.BIDI.
  2. Keep the session open about 9 minutes. The server sends goAway (timeLeft 30s), which produces an event with errorCode = "Unknown server message.". The connection then closes about 30 seconds later.
  3. For voiceActivity: also configure AutomaticActivityDetection through RealtimeInputConfig in the LiveConnectConfig (ADK has no RunConfig option for this today, so it has to be injected, for example by overriding Gemini.connectLiveTransport). Then speak and stop speaking. Each start and stop produces the same error event. I have not tested whether the server sends voiceActivity without that configuration.

Expected Behavior:

Valid Live messages are not reported as errors. goAway (including timeLeft) is available to the caller. ADK Python does this: LlmResponse.go_away (llm_response.py) is set in gemini_llm_connection.py (~line 670) and handled in live/_live_llm_flow.py (~line 260). voiceActivity signals should be surfaced or ignored, not turned into errors.

Observed Behavior:

From a real call (raw frames logged by a transport wrapper beneath ADK; tSec is seconds since connect):

[tSec=452] <- UNTRANSLATED frame (types=voiceActivity, adkWouldSay="Unknown server message"): {"voiceActivity":{"voiceActivityType":"ACTIVITY_START"}}
           -> ADK emits an event with errorCode="Unknown server message."
[tSec=453] <- UNTRANSLATED frame (types=voiceActivity, adkWouldSay="Unknown server message"): {"voiceActivity":{"voiceActivityType":"ACTIVITY_END"}}
           -> ADK emits an event with errorCode="Unknown server message."

[tSec=540] <- UNTRANSLATED frame (types=goAway, adkWouldSay="Unknown server message"): {"goAway":{"timeLeft":"30s"}}
           -> ADK emits an event with errorCode="Unknown server message."

[tSec=571] sendRealtimeInput FAILED (sinceLastInboundSec=30): java.util.concurrent.CompletionException: org.java_websocket.exceptions.WebsocketNotConnectedException
[tSec=571] close() called on transport (inboundFrames=129, counts={goAway=1, serverContent=124, serverContent+usageMetadata=2, voiceActivity=2})

So the server sent goAway with 30 seconds left (at 9:00), and it closed the connection exactly 30 seconds later (at 9:31). Nothing in ADK reacted, and the call died while the caller was still sending audio.

Environment Details:

  • ADK Library Version : 1.15.0
  • OS: macOS
  • Java Version (java -version): OpenJDK 21.0.7

Model Information:

  • Which model is being used: gemini-3.8-live

🟡 Optional Information

Regression:

No. main (1.15.1-SNAPSHOT) behaves the same way.

Logs:

See "Observed Behavior" above. Session identifiers and user details are removed. The full set of frame types for that session was: serverContent (124), serverContent+usageMetadata (2), voiceActivity (2), goAway (1).

Additional Context:

  • google-genai parses all of these messages correctly. Both fields are present on LiveServerMessage.
  • Suggested fix: add a goAway field (LiveServerGoAway) to LlmResponse, set it in GeminiLlmConnection when message.goAway() is present, and pass it through the live flow (and onto Event). Handle voiceActivity and voiceActivityDetectionSignal similarly, or at least ignore them without creating an error response.
  • Workaround today: wrap the transport returned by the protected Gemini.connectLiveTransport(...) and intercept these frames before they reach GeminiLlmConnection.
  • Related: Is SessionResumptionConfig planned to be added? #663 (session resumption). A client that gets goAway early can resume the session before the close. I'm filing a separate feature request for exposing live config (VAD, context window compression, session resumption) in RunConfig.

Minimal Reproduction Code:

Runner runner = new Runner(agent, "app", new InMemorySessionService());
RunConfig runConfig = RunConfig.builder()
    .setStreamingMode(RunConfig.StreamingMode.BIDI)
    .build();
runner.runLive(session, liveRequestQueue, runConfig)
    .subscribe(event -> {
      // After ~9 minutes on goAway (and on voiceActivity, if VAD is configured):
      // event.errorCode() == "Unknown server message."
    });

How often has this issue occurred?:

  • Always (100%): every goAway, and every voiceActivity frame when VAD is configured.

Activity

  1. self-assigned this
    on Nov 20, 2026
  2. added theissue type on Nov 20, 2026
  3. hemasekhar-p commented on Nov 20, 2026

    @hemasekhar-p
    Contributor

    Hi @aparnasharma285, thank you for reporting this issue. I have been able to reproduce it using your inputs. This issue is currently under review by our team, and we will keep you updated if we require any further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions