Repository navigation
Conversation
Ported from livekit/agents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d7cdd13 The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
fetch rejects a scheme-less URL without sending a request, which the retry loop treated as an outage. Also keep the underlying error in the final APIConnectionError message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
Ports livekit/agents#7314. Starting an Anam session now retries only failures that can succeed on a retry. Before, every failure was retried, including a bad API key or a bad request, which delayed the error by several retry intervals.
Changes Made
APIStatusErrorwith the status code and response body. A 4xx other than 408, 429 or 499 fails at once.APIConnectionError.maxRetrynow counts retries, as in Python, so a session start makes up tomaxRetry + 1attempts.Before / After
maxRetrytimes, thenAnamExceptionAPIStatusErrorAnamExceptionAPIStatusErrorTypeErrorAPIConnectionErrormaxRetry: 3Additional Notes
AnamExceptionaroundAvatarSession.start()will no longer catch API failures, because they now throw the sharedAPIStatusErrorandAPIConnectionErrorclasses, matching Python.AnamExceptionis still thrown for configuration errors.livekitTokenat the top level of the request body, but the token sits underenvironment, so debug and retry logs contained the full join token. The masking now coversenvironment.livekitToken.Pre-Review Checklist
Testing
restaurant_agent.tsandrealtime_agent.tswork properly (for major changes)Ran locally:
pnpm vitest run plugins/anam,pnpm buildandpnpm api:updateinplugins/anam,pnpm eslint plugins/anam/src(no errors) and Prettier on the changed files.Ported from livekit/agents#7314
🤖 Generated with Claude Code