Skip to content

create a new error object on timeout to have a correct stacktrace#853

Merged
toubatbrian merged 2 commits intolivekit:mainfrom
simllll:fix/utils
Nov 24, 2025
Merged

create a new error object on timeout to have a correct stacktrace#853
toubatbrian merged 2 commits intolivekit:mainfrom
simllll:fix/utils

Conversation

@simllll
Copy link
Copy Markdown
Contributor

@simllll simllll commented Nov 20, 2025

Description

small change, but helps to find where a task timeout actually is happening. Otherwise we have a wrong/no real backtrace on the uncaught error object.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: a0983ef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch

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

Create a new error object on timeout for accurate stack trace.
Comment thread agents/src/utils.ts
async cancelAndWait(timeout?: number) {
this.cancel();

try {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

just removed the try / catch, no code change exepct for the throw new Error('Task cancellation timed out'); in line 502

@toubatbrian toubatbrian merged commit a6d39c6 into livekit:main Nov 24, 2025
5 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 24, 2025
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