Skip to content

fix(cli): preserve quiet speech before detected onset - #5164

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/cli-keep-quiet-speech
Oct 7, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/cli-keep-quiet-speech

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

When speech starts quietly and becomes louder later, the relative energy onset can occur after words Whisper has already recognized. The CLI then deleted those early words from the transcript and captions.

Preserve every normalized decoder word at the shared command output step. Keep speech-onset metadata informational and remove the unused trimming helper.

Validation: the public-command Spanish regression fails on main when the early words disappear. The command and normalization suites pass three times each, and restoring the filter makes the regression fail again. Lint, formatting, comment checks, and CLI typecheck pass. A native multilingual decoder run on a soft-start Spanish clip independently confirmed meaningful speech before the estimated onset.

@miguel-heygen
miguel-heygen marked this pull request as ready for review October 7, 2026 07:13

@terencecho terencecho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at d61a723997fc0fbaebb84ea04c5d4fcf5ac2790a — approved.

packages/cli/src/commands/transcribe.ts:413-416 now writes the entire normalized decoder word array to transcript.json and caption HTML without applying the relative-energy onset as a word boundary. SRT/VTT export reads that same transcript. The public-command regression at packages/cli/src/commands/transcribe.test.ts:115-140 asserts all five supplied words in both outputs, including words before the 10-second onset. Six focused command/normalization suites passed (197 tests); required checks passed at this head. No previous review findings were present.

Nonblocking trade-off: A hallucinated decoder word over genuinely silent leading audio will now also be retained; the old timestamp filter could suppress it but also deleted real quiet speech. This is consistent with the stated preserve-normalized-words contract, not evidence that native recognition is complete. The test mocks decoder output and onset; I did not independently run a native model. speechOnsetSeconds remains an energy estimate, so the status line at transcribe.ts:432-439 can say “speech detected at 10.0s” despite preserved words beginning earlier. Consider labeling it as an estimated energy onset to avoid suggesting a first-word boundary.

— tai

Verdict: APPROVE
Reasoning: The command no longer drops recognized normalized words at an unreliable energy boundary, and its JSON and caption outputs remain aligned. The silent-intro false-positive trade-off and onset wording do not contradict the explicitly chosen inclusive output contract.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 2059 (base branch 2059), smooth 1619 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit e21ab02 Oct 7, 2026
80 checks passed
@miguel-heygen
miguel-heygen deleted the fix/cli-keep-quiet-speech branch October 7, 2026 07:59
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.

2 participants