Skip to content

Broken streaming tts retries #4409

@jayeshp19

Description

@jayeshp19

Bug Description

it looks like streaming TTS retries are broken. The retry loop reuses the same SynthesizeStream instance, but the _input_ch channel and plugin state are one-shot resources that get consumed during the first attempt.

As a result, retrying the same request sends no text or produces no segments, leading to consistent failures like APIError: no audio frames were pushed or segments mismatch.

related issues: #4135

Expected Behavior

we should be able to replay events during retry

Reproduction Steps

1. 
2.
3.
...
- Sample code snippet, or a GitHub Gist link -

Operating System

Macos

Models Used

No response

Package Versions

livekit-agents=1.3.10

Session/Room/Call IDs

No response

Proposed Solution

Additional Context

No response

Screenshots and Recordings

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions