fix(flow): improve tail capture and final chunk ASR recovery

- Add FlowUtteranceEndCoordinator with 350ms silence drain and 150ms post-roll
- Extend FinalChunkRecovery for short/empty final chunks in chunked pipeline
- Snapshot partial at mic stop and guard final transcript in FlowSessionManager
- Unify tail drain presets (iosFlow/macMLX) and expand diagnostics

Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-26 10:13:40 +00:00
parent e6f99d2744
commit c7ee891a90
16 changed files with 485 additions and 42 deletions
@@ -56,7 +56,11 @@ public enum UtteranceStreamChunker {
} else if chunkIndex == 0 {
// Empty utterance no chunks.
} else {
// Stream ended exactly on boundary; mark prior path complete.
// Stream ended exactly on a chunk boundary; prior emit holds
// all tail audio. Marker so FinalChunkRecovery paths run.
continuation.yield(
UtteranceAudioChunk(index: chunkIndex, samples: [], isLast: true)
)
}
continuation.finish()