Google Live API connection closes after ~2–3 minutes of inactivity without GOAWAY notice

I am experiencing an unexpected connection termination behavior when using the Google Live API.

After successfully establishing a connection and enabling the rendering/filtering pipeline, if no further actions or messages are sent (i.e., the connection remains idle), the connection is automatically closed after approximately 2–3 minutes. At that point, I receive an error/response indicating the connection has been terminated, and the client is disconnected.

Key observations:

  • I do not receive a GOAWAY or any advance notice indicating that the connection is about to be closed.

  • According to the documentation, the expected idle timeout appears to be around 10 minutes, but in practice the first disconnection consistently happens after ~2–3 minutes.

  • Because of this, I currently have to manually handle the disconnect event and explicitly re-establish the connection on the client side.

My questions are:

  1. Is this early disconnection after 2–3 minutes of inactivity expected behavior?

  2. If so, what is the intended keep-alive or heartbeat mechanism to prevent the connection from being closed?

  3. Is there a reason this shorter idle timeout is not documented, or is it environment- or configuration-dependent?

Any clarification on the actual idle timeout policy and best practices for maintaining a persistent connection would be greatly appreciated.

Hi @Kasei,
Welcome to the AI Forum!
Thanks for reporting this issue.
We were not able to replicate this. The timeout and go away notice seems to work correctly on our end. If you are still facing this problem, could you please share the code snippet, to reproduce this issue?