Skip to content

Recording cap: a latched recording runs up to an hour - #122

Merged
dinooo13 merged 1 commit into
mainfrom
t3/fix-long-dictation-cancelled
Nov 17, 2026
Merged

dinooo13 merged 1 commit into
mainfrom
t3/fix-long-dictation-cancelled

Conversation

@dinooo13

Copy link
Copy Markdown
Owner

The problem

With a few very long dictations they just get cancelled at some point and the UI just disappears with a sound like I ended the recording, and it was transcribed. I can paste it manually if I want.

It is the 10 min recording cap. The app's log has a hands-free recording that started at 06:40:07 and ended at exactly 06:50:07, audio 600.0 s. The cap is there for a held key whose key-up is lost, but it also ends a latched recording, which has no key-up to lose, so a dictation meant to be that long is cut off with the stop sound and pasted.

The fix

A held recording keeps the 10 min cap. A recording that is latched by the time the held cap is reached runs to 60 min (DictationCoordinator.latchedMaximumDuration); it is asked then and not at the press, because a hybrid key latches at its release. The engine's copy of the audio for the live pass now keeps only its last window or two, cut on whole hops so the live window lands where it did, so an hour-long dictation leaves no 230 MB buffer behind. CLAUDE.md, ARCHITECTURE, USAGE and BENCHMARKS say the new caps.

How it was proved

  • swift test: all suites pass. theCapFiresInToggleMode became aLatchedRecordingOutlastsTheHeldCap: still recording past 10 min, recording 1 s before 60 min, pasted with no send at 60 min. With the latch check switched off it fails; the held-cap test is unchanged and passes.
  • check-doc-pointers.sh and check-site-numbers.sh pass.
  • 60 min fixture (the 10m one joined six times, 3,789 s) through the real engine on the M1 with bench --paced --runs 3 --pause 5, the bench's sleep removed locally so the audio fed as fast as the windows ran (not committed):
Fixture endUtterance (median) WER Identical whole-buffer
10m 0.179 s 0.5 % yes
60m 0.206 s 0.6 % yes

Critical path: nothing between recordingStopped and inserted changed. The trim is in feed, which runs while the key is held, roughly every 10 s, a ~1 MB move; the release waits on it only if it lands in the last chunk. No before-and-after bench --paced run of the full fixture set.

Not proved: a real latched recording past 10 min in the app (needs synthetic hotkeys or an hour of the developer's time), and the live transcript's text after a trim.

Not in this PR

The capped dictation's clipboard was read 3.0 s after Cmd+V, where every other dictation reads in about 0.01 s, so the automatic paste may not have landed. Not reproduced; worth a look if it happens again.

🤖 Generated with Claude Code

The 10 min cap is there for a held key whose key-up is lost, but it also
ended hands-free recordings at 600 s, with the stop sound and a paste, in
the middle of a dictation meant to be that long. A held recording keeps
10 min; one latched by the time the held cap is reached runs to 60 min,
asked then because a hybrid key latches at its release.

The engine's copy of the audio for the live pass now keeps only its last
window or two, so an hour leaves no 230 MB buffer behind. A 60 min fixture
paced in leaves 0.206 s at release against 0.179 s at 10 min, with the
text identical to the whole-buffer pass (docs/BENCHMARKS.md, "Past ten
minutes").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinooo13
dinooo13 merged commit bbc22ce into main Nov 17, 2026
4 checks passed
@dinooo13
dinooo13 deleted the t3/fix-long-dictation-cancelled branch November 17, 2026 12:58
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