Skip to content

fix: make long GLM-ASR dictation recoverable and resilient - #71

Open
YidaHu wants to merge 1 commit into
tover0314-w:mainfrom
YidaHu:fix/glm-asr-long-dictation-recovery
Open

fix: make long GLM-ASR dictation recoverable and resilient#71
YidaHu wants to merge 1 commit into
tover0314-w:mainfrom
YidaHu:fix/glm-asr-long-dictation-recovery

Conversation

@YidaHu

@YidaHu YidaHu commented Jul 3, 2026

Copy link
Copy Markdown

Summary

This PR improves long-form dictation reliability for GLM-ASR and makes failed transcription attempts recoverable.

Changes

  • Preserve a local WAV snapshot before transcription so users do not lose recordings when STT fails.
  • Store recent recordings under the app support directory with latest.wav / latest.json helpers for recovery.
  • Add provider-level request duration limits and split GLM-ASR audio into safe chunks before upload.
  • Stitch chunked GLM-ASR results back into a single transcript.
  • Increase the STT finalization timeout for longer dictation sessions.
  • Use an audio-length-aware HTTP timeout instead of a fixed short timeout.
  • Surface audio send failures instead of silently ignoring them.
  • Improve macOS output fallback by copying text to clipboard when direct keyboard output is unavailable.

Why

GLM-ASR rejects audio longer than its provider-side request duration limit. Before this change, longer dictation could fail after recording, and the original audio was not retained for retry or recovery.

With this PR, long dictation is split into provider-safe requests, and the original recording is preserved locally before transcription starts.

Validation

  • cargo test
  • npm test
  • Manually verified the GLM-ASR provider duration limit and confirmed shorter chunked requests can be transcribed successfully.

Privacy

Recorded audio is saved only to the user's local app support directory for recovery. This PR does not add telemetry or upload recordings anywhere other than the configured STT provider request path.

@YidaHu
YidaHu requested a review from tover0314-w as a code owner July 3, 2026 10:54
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