Skip to content

fix: Bound memory use for long dictation recordings - #878

Closed
mvanhorn wants to merge 1 commit into
altic-dev:mainfrom
mvanhorn:fix/843-long-dictation-memory
Closed

mvanhorn wants to merge 1 commit into
altic-dev:mainfrom
mvanhorn:fix/843-long-dictation-memory

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Description

Add a production-used long-dictation policy inside ASRService that applies the existing 20-minute file-transcription bound to live preview and final dictation work, while leaving shorter recordings on their current single-pass path. Once a recording reaches that bound, retain the last successful live preview but skip further full-prefix preview copies/inference; at stop, split normal dictation PCM into ordered, non-empty ranges no larger than the bound, fold any sub-second tail into the preceding range, and run transcribeFinal serially for each range through the existing TranscriptionExecutor. Combine non-empty chunk results in order, derive aggregate confidence from completed chunks, and apply filler removal, dictionary replacement, spoken-punctuation formatting, audio snapshot handling, and the existing ContentView history flow once to the combined result.

FluidVoice can terminate while finalizing a roughly 50–80 minute local dictation, leaving no transcription history entry because ContentView only persists history after ASRService.stop() returns text. The issue thread provides a repeatable long-recording case on Apple Silicon, and the maintainer identifies memory pressure from retaining and processing the growing recording as the likely cause. The current streaming path repeatedly obtains the entire accumulated PCM prefix, while the final path sends the full recording through one provider inference; both operations grow without a duration bound. File transcription already avoids the same class of failure by processing long audio in 20-minute chunks.

Closes #843

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Closes #(issue number), or links to an accepted Discussion/roadmap item.

Testing

  • Tested on Intel Mac
    Not verified: this needs a person on the named hardware or environment.
  • Tested on Apple Silicon Mac
    Not verified: this needs a person on the named hardware or environment.
  • Tested on macOS version:
    Not verified: this needs a person on the named hardware or environment.
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources
    Not run: no test command resolved in this workspace, so nothing was executed to pass.
  • Ran formatter locally: swiftformat --config .swiftformat Sources
    Not run: no test command resolved in this workspace, so nothing was executed to pass.
  • Ran tests locally:
  • A recording below 20 minutes remains eligible for streaming preview and produces one final range covering every sample, preserving the existing short-recording path. - A 50-minute, 16 kHz sample count becomes three ordered final ranges whose union covers every sample exactly once and whose individual sizes never exceed 20 minutes; preview work is rejected after the bound instead of requesting the whole prefix again. - A recording exactly on the boundary produces one range, while a recording just over the boundary does not create a sub-second final request: the short remainder is folded into the prior range without dropping or duplicating samples.

Screenshots / Video

Attach screenshots or a video for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes.

  • No UI/visual changes; screenshots/video are not applicable.
    Not verified: this needs a person on the named hardware or environment.

Notes

Add reviewer context, rollout notes, or known tradeoffs here.

@github-actions github-actions Bot added needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

This PR has been closed because it still does not follow the required PR template after the 48-hour correction window.

Please open a new PR with the required description, related issue or accepted Discussion, testing notes, and screenshot/video evidence when applicable.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR bounds long-dictation transcription work by pausing full-prefix streaming previews at 20 minutes and serially transcribing ordered final chunks.

  • Keeps shorter recordings on the existing single-pass path.
  • Selects quiet chunk boundaries while preventing empty or sub-second tails.
  • Combines usable chunk text and confidence before applying the existing post-processing flow.
  • Adds coverage for range construction, preview cutoff, result aggregation, and error propagation.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified.

The changed path preserves single-pass behavior for short recordings, covers long recordings with contiguous bounded ranges, processes chunks serially, and retains the established stop and provider lifecycle behavior.

Reviews (1): Last reviewed commit: "fix: address self-review findings" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash during processing after stopping recording—no history entry.

1 participant