Skip to content

Conversation

@vm0809
Copy link

@vm0809 vm0809 commented Nov 7, 2025

Description
This PR fixes the TTS SynthesizeStream to properly handle retryable APIError conditions. It ensures that errors are only emitted after all retry attempts are exhausted, and it makes the retry logic more robust for all relevant APIError types.

Changes Made
Delay error emission until all retry attempts are completed.
Use a dynamic recoverable flag for error types based on their properties.
Prevents ERR_UNHANDLED_ERROR crashes and premature session termination.
Cleans up and documents retry mechanism.
Pre-Review Checklist
Build passes: Lint, typecheck, and tests pass locally
AI-generated code reviewed: Ensured code quality and removed unnecessary comments
Changes explained: All changes are documented and justified above
Scope appropriate: Only TTS error-handling logic is changed; no unrelated changes
Testing
Automated and manual tests confirm retry and error-handling logic work as expected
Confirmed core TTS flows in restaurant_agent.ts and realtime_agent.ts function as intended

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 4f02a85

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Nov 7, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants