Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Skip error recovery on intentional cancellation (#477)
When SlidingWindowAsrManager is cancelled, CancellationError propagates
through processWindow() and the audio buffer loop. Previously this
triggered attemptErrorRecovery() which resets the decoder and, as a
last resort, re-downloads models — neither of which is appropriate for
an intentional shutdown.

Guard both catch sites with `error is CancellationError || Task.isCancelled`
to return immediately instead.

Fixes #477

https://claude.ai/code/session_01696MyMtoiM6T8ruCdCCHab
  • Loading branch information
claude committed Apr 4, 2026
commit 6be4fd221296b74a92b12b953a8c80331360f573
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ public actor SlidingWindowAsrManager {
// Append to raw sample buffer and attempt windowed processing
await self.appendSamplesAndProcess(samples)
} catch {
if error is CancellationError || Task.isCancelled {
return
}
let streamingError = SlidingWindowAsrError.audioBufferProcessingFailed(error)
logger.error(
"Audio buffer processing error: \(streamingError.localizedDescription)")
Expand Down Expand Up @@ -470,6 +473,9 @@ public actor SlidingWindowAsrManager {
updateContinuation?.yield(update)

} catch {
if error is CancellationError || Task.isCancelled {
return
}
let streamingError = SlidingWindowAsrError.modelProcessingFailed(error)
logger.error("Model processing error: \(streamingError.localizedDescription)")

Expand Down
Loading