Land release blocker fixes and workspace cleanup
This commit is contained in:
@@ -4,6 +4,33 @@
|
||||
**Path:** `src-tauri/src/commands/live.rs:349-579`
|
||||
**Source:** [2026-04-22 code review](../code-review-2026-04-22.md)
|
||||
**Labels:** release-blocker, major, refactor, concurrency
|
||||
**Status:** RESOLVED (2026-04-22)
|
||||
|
||||
## Resolution
|
||||
|
||||
`run_live_session` was split around two explicit state holders:
|
||||
|
||||
- `ActiveCapture` owns the cpal stream handle, audio receiver, and
|
||||
optional runtime-error channel.
|
||||
- `LiveLoopState` owns the mutable per-session loop state: resampler,
|
||||
capture buffer, WAV writer, buffer offsets, dropped-audio accounting,
|
||||
in-flight inference task, and duplicate-history buffer.
|
||||
|
||||
The top-level worker is now `LiveSessionRuntime`, with focused methods
|
||||
for:
|
||||
|
||||
- polling in-flight inference
|
||||
- draining microphone runtime warnings
|
||||
- receiving + resampling an audio chunk
|
||||
- dropping pending-buffer overflow
|
||||
- flushing the resampler tail when stop is requested
|
||||
- dispatching inference when enough audio is buffered
|
||||
- draining the last in-flight task
|
||||
- finalising the progressive WAV writer
|
||||
|
||||
This keeps behaviour intact but removes the "everything in one mutable
|
||||
loop" shape that made concurrency review hard. The refactor also made
|
||||
RB-01 straightforward enough to land immediately afterward.
|
||||
|
||||
## Problem
|
||||
|
||||
|
||||
Reference in New Issue
Block a user