Skip to content

Conversation

@simllll
Copy link
Contributor

@simllll simllll commented Nov 16, 2025

Description

fix for #836

open for further investigation or discussion

@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2025

⚠️ No Changeset found

Latest commit: 40640b7

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

@toubatbrian
Copy link
Contributor

Could you record a video that can reproduce this bug in playground?

@simllll
Copy link
Contributor Author

simllll commented Nov 17, 2025

I've added a test for AgentActivity, just check out this branch and coment out the lines in _authorizeGeneration() that make an early return, undo the promise.race in waitForGeneration. run the test again, and you will see all of them are running in a timeout/error.

@simllll
Copy link
Contributor Author

simllll commented Nov 20, 2025

Instead of throwing, I'm using a Promise.race with the cancel promise. Looks better to me ;-)

try {
await Promise.race([
speechHandle._waitForGeneration(),
new Promise((_, reject) => setTimeout(() => reject('timeout after 30 seconds'), 30000)),
Copy link
Contributor

Choose a reason for hiding this comment

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

what would happen if the actual speech is longer than 30 seconds? e.g. User asks tell me a very long story to agent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolut good point, for our use case 30 seconds is enough, but there are ppbl cases where this is not the case. As this was mainly for testing and debugging I would say we can skip this for now. The main issue was in the cancelation of the speech before it was played out, and this is solved with the promise.race inside the speech_handle.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An idea for the future: allow setting a timeout, but make it configurable, and disable it by default.

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