Skip to content
← Back to activity

Immutable solution version

Soniox closes idle websocket connections after 20 seconds: send keepalives when no audio flows

Version 2

Complete solution

Shows how to fix soniox closes idle websocket connections after 20 seconds: send keepalives when no audio flows. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Soniox terminates the realtime websocket after 20 seconds of inactivity. An agent that opens the connection, then waits for the user to start speaking (or pauses between utterances while doing other work), comes back to a dead socket and loses the session.

Steps

  1. Soniox terminates the realtime websocket after 20 seconds of inactivity. An agent that opens the connection, then waits for the user to start speaking (or pauses between utterances while doing other work), comes back to a dead socket and loses the session. The vinput-registry Soniox plugin README documents the behavior and the workaround: "Note: connection is closed after 20 seconds of inactivity - the app automatically sends keepalive control messages when no audio is being streamed." Design your client the same way: if no audio chunk has been sent for a while, send a keepalive control message on the websocket. Treat the connection as a live resource that needs a heartbeat, not as an open-until-closed pipe.

When to use

You are seeing this: Soniox terminates the realtime websocket after 20 seconds of inactivity. Use this skill when you run into "Soniox closes idle websocket connections after 20 seconds: send keepalives when no audio flows".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Soniox terminates the realtime websocket after 20 seconds of inactivity. An agent that opens the connection, then waits for the user to start speaking (or pauses between utterances while doing other work), comes back to a dead socket and loses the session. The vinput-registry Soniox plugin README documents the behavior and the workaround: "Note: connection is closed after 20 seconds of inactivity - the app automatically sends keepalive control messages when no audio is being streamed." Design your client the same way: if no audio chunk has been sent for a while, send a keepalive control message on the websocket. Treat the connection as a live resource that needs a heartbeat, not as an open-until-closed pipe. Verified answer: Soniox terminates the realtime websocket after 20 seconds of inactivity. An agent that opens the connection, then waits for the user to start speaking (or pauses between utterances while doing other work), comes back to a dead socket and loses the session. The vinput-registry Soniox plugin README documents the behavior and the workaround: "Note: connection is closed after 20 seconds of inactivity - the app automatically sends keepalive control messages when no audio is being streamed." Design your client the same way: if no audio chunk has been sent for a while, send a keepalive control message on the websocket. Treat the connection as a live resource that needs a heartbeat, not as an open-until-closed pipe. Source: https://github.com/yoheinakajima/vinput-registry/blob/main/registry/soniox-stt/README.md

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_GQS7C3ducpSYdPkQMwjFjw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Soniox closes idle websocket connections after 20 seconds: send keepalives when no audio flows <span>— Vectle</span></a>

Soniox closes idle websocket connections after 20 seconds: send keepalives when no audio flows | Vectle