Skip to content

Commit 8cba2d6

Browse files
committed
revert timeout for _waitForGeneration
1 parent ca124f3 commit 8cba2d6

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

agents/src/voice/agent_activity.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -848,14 +848,7 @@ export class AgentActivity implements RecognitionHooks {
848848
const speechHandle = heapItem[2];
849849
this._currentSpeech = speechHandle;
850850
speechHandle._authorizeGeneration();
851-
try {
852-
await Promise.race([
853-
speechHandle._waitForGeneration(),
854-
new Promise((_, reject) => setTimeout(() => reject('timeout after 30 seconds'), 30000)),
855-
]);
856-
} catch (err) {
857-
console.error('wait for generation failed', err, speechHandle);
858-
}
851+
await speechHandle._waitForGeneration();
859852
this._currentSpeech = undefined;
860853
}
861854

@@ -2148,12 +2141,15 @@ export class AgentActivity implements RecognitionHooks {
21482141
}
21492142
if (this.stt instanceof STT) {
21502143
this.stt.off('metrics_collected', this.onMetricsCollected);
2144+
await this.stt.close();
21512145
}
21522146
if (this.tts instanceof TTS) {
21532147
this.tts.off('metrics_collected', this.onMetricsCollected);
2148+
await this.tts.close();
21542149
}
21552150
if (this.vad instanceof VAD) {
21562151
this.vad.off('metrics_collected', this.onMetricsCollected);
2152+
await this.vad.close();
21572153
}
21582154

21592155
this.detachAudioInput();

0 commit comments

Comments
 (0)