chore: remove dormant reconnectEvent infrastructure in inference STT - #2439
Open
detail-app[bot] wants to merge 1 commit into
Open
Conversation
|
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
Removed the dormant
reconnectEvent-based reconnect loop infrastructure fromSpeechStream.run()inagents/src/inference/stt.ts. This simplifies the connection loop to a single iteration:await ThrowsPromise.all(taskResults); break;.Changes Made
private reconnectEvent = new Event();fieldwaitReconnectTaskTask definition and theThrowsPromise.race([..., waitReconnectTask.result])race (replaced withawait ThrowsPromise.all(taskResults))if (!waitReconnectTask.done) break;conditional andthis.reconnectEvent.clear();(simplified to a straightbreak;)waitReconnectTaskfrom the cleanuptasksarrayEventandwaitForAbortfrom the../utils.jsimport (no longer referenced)Context
The reconnectEvent was the trigger for a mid-stream reconnect cycle:
updateOptionspreviously calledthis.reconnectEvent.set()to makewaitReconnectTaskwin the race and restart the outerrun()loop for a fresh WebSocket. Commit 6dc619f replaced that trigger with a mid-streamsession.updateWebSocket message and deleted the.set()call, but left the reconnect infrastructure in place. SincereconnectEvent.set()was never called anywhere instt.ts(no other caller in the repo),waitReconnectTaskcould only resolve via thewaitForAbortbranch — which fires in thefinallyblock after the inner tasks had already finished. Theall(taskResults)branch always won the race and the outerwhile (true)loop always broke on the first iteration, making the reconnect path dead and the loop effectively single-iteration.Runtime behavior is unchanged. Verification:
pnpm build,tsctypecheck,eslintonstt.ts, and all 73 tests insrc/inference/stt.test.tspass (1 pre-existing skip).api-extractorconfirms the public API surface is unchanged.History
Pre-Review Checklist
Testing
restaurant_agent.tsandrealtime_agent.tswork properly (for major changes)Additional Notes
This is a dead-code removal only; no refactor of live consumers was performed. The reconnect-via-
session.updatepath inupdateOptions(the live replacement forreconnectEvent.set()) is untouched.Detail: Dead Code
Dead Code PRs can be configured here.