Scale Cloud Whisper timeout for long recordings#646
Open
katanumahotori wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Codex <codex@openai.com>
PR Reviewer Guide 🔍(Review updated until commit c7a65b9)Here are some key observations to aid the review process:
|
Contributor
Author
|
Clarification: this PR is not intended to implement the full history recording/retranscription feature request. That functionality is already present on beta. This PR only fixes the remaining fixed 15s Cloud Whisper timeout in normal dictation and in the existing retranscription path. |
Co-Authored-By: Codex <codex@openai.com>
|
Persistent review updated to latest commit c7a65b9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Why
Long Cloud Whisper-compatible recordings can take longer than the existing 15s coordinator guard to transcribe. In that case the recording is marked as a timeout even though the provider may still be working. This is especially visible for multi-minute recordings.
The new timeout is:
ceil(audio_secs * 0.5) + 15For example, a 422s recording now gets a 226s timeout instead of 15s.
The same timeout is also used when retranscribing an archived recording, where the exact PCM duration is available.
Validation
cargo test cloud_whisper_timeout --libpassed: 5 testscargo testpassed: 521 testscargo build --releasepassedNote:
cargo fmt --checkcurrently reports unrelated existing formatting diffs in upstream files outside this PR, so I did not apply broad formatting changes.PR Type
Enhancement, Bug fix
Description
Replace fixed 15s coordinator timeout with audio-duration-aware timeout for Cloud Whisper
Apply same timeout to retranscription path and add Apple Speech retranscription support
Add boundary tests for short, zero, long, capped, and exact-cap recordings
Diagram Walkthrough
File Walkthrough
coordinator.rs
Use dynamic timeout in retranscribe_pcm and add Apple Speechopenless-all/app/src-tauri/src/coordinator.rs
pcmmodule to compute audio durationretranscribe_pcmto usecloud_whisper_transcribe_timeoutforWhisper provider
local_qwen_transcribe_timeoutasr_setup.rs
Add timeout constants and scaling function for Cloud Whisperopenless-all/app/src-tauri/src/coordinator/asr_setup.rs
CLOUD_WHISPER_MIN_TIMEOUT_SECS(30) andCLOUD_WHISPER_MAX_TIMEOUT_SECS(300)cloud_whisper_transcribe_timeoutfunction with formulaceil(audio_secs * 0.5) + 15, clamped between min and maxdictation_end.rs
Use audio-aware timeout in Cloud Whisper end_sessionopenless-all/app/src-tauri/src/coordinator/dictation_end.rs
COORDINATOR_GLOBAL_TIMEOUT_SECSwith dynamiccloud_whisper_transcribe_timeoutinend_sessionfor Whisper providertests.rs
Add unit tests for cloud_whisper_transcribe_timeoutopenless-all/app/src-tauri/src/coordinator/tests.rs
for 422s, cap at 1000s, exact cap boundary at 570s