fix: fix openai asr reconnection issue#2163
Conversation
ReviewNice diagnosis — combining a priority queue at the transport layer with client-side buffering of audio/commit until Bugs / correctness
Code quality
TestsNo tests added. The reconnection race and the flush-on-ready paths are exactly the kind of logic that silently regresses. Even a small unit test around Nits
Overall the approach is sound; the main thing I'd ask for before merging is a bound on |
ReviewThe fix addresses a real problem (audio sent before Potential issues1. Ordering race during flush in self.params_ready_event.set()
await self._flush_pending_audio()Between Two options: (a) drain 2. 3. 4. Hardcoded 8 MB cap ( 5. 6. 7. Clearing pending state on shutdown only ( Test coverageThe PR adds non-trivial state machine logic (priority ordering, drop policy, buffer/flush across reconnects, commit coalescing) but no new tests under
Minor / style
Overall the direction is correct; the ordering race in (1) is the one I'd most want addressed (or explicitly acknowledged as acceptable) before merge. |
5ad8c92 to
f5ad6fc
Compare
PR #2163 Review —
|
No description provided.