Repository navigation
docs: the timestamped TTS WebSocket stays open after most errors - #482
Merged
Merged
Conversation
The ErrorEvent description said the socket always closes after an error. An invalid StartEvent, a missing voice reference or another error in what the client sent ends the session but keeps the socket open for another StartEvent. A concurrency refusal closes it, and a server-side failure can close it too.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
lumpinif
added a commit
that referenced
this pull request
Dec 3, 2026
* docs: the TTS WebSocket connection stays open after finish
The spec said the server closes the connection after FinishEvent. It
does not: the connection stays open and accepts another StartEvent, as
the /v1/tts/live/with-timestamp reference already says.
* docs: describe the error event on the TTS WebSocket
/v1/tts/live answers a failed session (unknown reference_id, out-of-range
value) with {event: error, error: <message>}, sends no finish after it and
leaves the connection open. The AsyncAPI did not list ErrorEvent for ttsLive,
said the socket closes after it, and the API skill told agents that failures
arrive as finish with reason error, so a client built from either waited
forever. List ErrorEvent on ttsLive, say that no FinishEvent follows it and
that a client should end the session and close the connection, note that an
unsupported format closes the connection without an event, and make the
skill's raw WebSocket samples handle both.
* docs: TTS WebSocket errors per endpoint, handshake refusals, and sample fixes
- finish ends the synthesis session, not the connection, as in the
connection-after-finish change this builds on.
- ErrorEvent keeps the shared payload; what happens to the connection is
stated on each server operation (checked live on both endpoints).
- Say that a refused handshake (for example 401) returns an HTTP status with
no event.
- Node example: treat an empty error message as a failure and write no file
for a failed session. Python example: a text source that raises now ends
the run with its own exception instead of waiting.
* docs: TTS WebSocket samples end on a text-source failure and write the file after finish
The Python sample caught ConnectionClosed around the whole sender, so a text
source that raised ConnectionClosed was swallowed and the sample hung. Only
writes to the Fish socket are guarded now; a text-source error ends the
receiver and reaches the caller. Both samples write to out.mp3.part and
rename it after finish. The with-timestamp endpoint guide states the same
three ways a session ends as the AsyncAPI file.
* docs: close the TTS WebSocket with code 1000; open connections between sessions are not counted
Adds to the /v1/tts/live FinishEvent the two statements #481 added to the
with-timestamp FinishEvent, in the same wording.
* docs: smallest raw TTS WebSocket examples, and connection behaviour after an error per #482
- The API skill's Python and Node examples send start, the text and stop, then
read in one loop: audio is kept in memory, finish with reason stop writes the
file, error / finish with reason error / a close before finish fail with the
server's message, unknown events are ignored, the socket closes with 1000.
One sentence points LLM streams to the SDK.
- FinishEvent no longer says exactly one per session; it lists the outcomes
that end a session.
- ErrorEvent bullets follow the merged ErrorEvent text: after an error in what
you sent the socket stays open for another start; a concurrency refusal
closes it. The AsyncAPI operations point to ErrorEvent for this.
- The with-timestamp guide says only finish with reason stop is success and to
show message on reason error.
* docs: raw TTS WebSocket examples report an empty error and the close code; note the Python SDK release gap
The Python SDK 1.8.1 waits after a standalone error event; the fix is in the SDK
repository and ships with the next release.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: the AsyncAPI
ErrorEventon the WebSocket TTS with Timestamps page said "The socket closes afterwards" after any error. That is true only for some errors. After an invalidStartEventor a missing voice reference, the session ends and the socket stays open, so you can send anotherStartEventon it.After: the
ErrorEventdescription (Receive > Request Error) now says:StartEvent, a missing voice reference, or another error in what you sent, the session ends but the socket stays open, so you can send anotherStartEvent.Only the
ErrorEventtext changes.Checked:
mint validateandmint broken-linksgive the same results asmain(existing errors only).prettier --checkpasses on the changed file.Preview:
ErrorEvent(Receive > Request Error; the rendered message has no anchor): api-reference/endpoint/openapi-v1/text-to-speech-live-with-timestampsOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.