Skip to content

fix(transcription): survive a recognizer panic instead of killing the worker#8

Open
farce1 wants to merge 1 commit into
mainfrom
fix/recognizer-panic-resilience
Open

fix(transcription): survive a recognizer panic instead of killing the worker#8
farce1 wants to merge 1 commit into
mainfrom
fix/recognizer-panic-resilience

Conversation

@farce1

@farce1 farce1 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

If WhisperRecognizer::transcribe ever panics (a Rust panic inside the sherpa-rs binding — e.g. on unexpected output), the panic unwinds the transcription worker thread. The forwarder then sees the result channel disconnect and marks the session transcription-degraded — so a single bad chunk silently ends transcription for the entire rest of the meeting.

Fix

Wrap the ASR call in catch_unwind (catch_panic helper): a panicking chunk is logged and skipped, and the worker keeps processing subsequent audio. This mirrors Handy's documented "catch_unwind around the engine" practice. The happy path is byte-identical (Some(result)); only the panic path changes.

Verification (TDD)

  • RED→GREEN: catch_panic tests (Some on success, None on panic).
  • clippy --all-targets --all-features -- -D warnings ✅; full cargo test → 2 new tests pass, only the pre-existing model_archive_consts_tests (REPLACE_WITH_ placeholders) fail.

Notes

⚠️ CI red on maintainer-only blockers (not this PR)

Uncommitted vendor/vc_redist.x64.exe + REPLACE_WITH_ SHA256/pubkey placeholders. Verified locally with a temp untracked vendor placeholder. Code-only, no new deps.

… worker

A Rust panic inside the Whisper recognizer's transcribe call unwound the worker
thread, ending transcription for the rest of the meeting (the forwarder then
marks it degraded). Wrap the call in catch_unwind so a single bad chunk is
skipped and the worker keeps going. Mirrors Handy's catch_unwind-around-the-engine
practice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant