Skip to content

fix(voice): stop recreating STT stream on non-retryable errors - #7173

Closed
phillip-kil wants to merge 4 commits into
livekit:mainfrom
phillip-kil:fix/stt-pump-honour-retryable
Closed

fix(voice): stop recreating STT stream on non-retryable errors#7173
phillip-kil wants to merge 4 commits into
livekit:mainfrom
phillip-kil:fix/stt-pump-honour-retryable

Conversation

@phillip-kil

@phillip-kil phillip-kil commented Sep 8, 2026

Copy link
Copy Markdown

_STTPipeline._stt_pump in livekit-agents/livekit/agents/voice/audio_recognition.py recreates stream on every APIError regardless of APIError.retryable. So we are applying retries on permanent failures until the retries are exhausted.

The code already describes the intended behaviour to stop on retryable=False, but does not apply the condition anywhere.

This is the only pump that ignores retryable. llm/llm.py:316, stt/stt.py:246,477, inference/interruption.py:466 and inference/eot/transports.py:287 all check the property before retrying.

Addresses #7172

@phillip-kil
phillip-kil requested a review from a team as a code owner September 8, 2026 14:53
@CLAassistant

CLAassistant commented Sep 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment thread livekit-agents/livekit/agents/voice/audio_recognition.py
Comment on lines 221 to 224
logger.warning(
"STT stream ended on an unrecoverable error, recreating",
"STT stream ended on a retryable error, recreating",
exc_info=True,
)

@devin-ai-integration devin-ai-integration Bot Sep 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 STT exceptions bypass log redaction

Retryable failures log exc_info=True, exposing the API exception and its cause chain. Provider errors can contain customer audio metadata, response payloads, headers, or credentials. Tracebacks cannot be redacted through a PII-tagged field.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a regression introduced by this PR, so I'd leave this as is.

@longcw

longcw commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

#7172 (comment)

@longcw longcw closed this Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants