Skip to content

fix(speech): restore CPU recovery when streams finalize - #30855

Merged
gitcafe-production[bot] merged 1 commit into
pingdotgg:takeover/14882-voice-enginefrom
UtkarshUsername:fix/speech-stream-finalization-recovery
Nov 4, 2026
Merged

gitcafe-production[bot] merged 1 commit into
pingdotgg:takeover/14882-voice-enginefrom
UtkarshUsername:fix/speech-stream-finalization-recovery

Conversation

@UtkarshUsername

Copy link
Copy Markdown
Contributor

Problem

Auto placement recovers from native stream begin/feed failures, but a failure from finish() bypasses CPU recovery. The recording therefore fails even when the same selected environment can finalize it on CPU.

Change

Route finalization failure through the existing one-shot CPU restart, replay all retained chunks in order, then finalize the replacement stream. Keep explicit GPU/CPU failures as errors, preserve language and dictionary correction, and reject further work after terminal finalization failure. Cancellation and stream ownership stay in the existing scope.

Scope and approval

This is a focused fix for the missing finalization branch of existing Auto recovery, targeting Julius's engine branch (#30625). It adapts the behavior from original commit acd5b8ad030140b9046d6e752873147b41540447; it does not restore the old service or add recovery policies. The original contribution was superseded as explained in the takeover comment. No separate maintainer approval is claimed.

Verification

  • Before the fix, both empty and nonempty finalization-recovery cases fail with the injected GPU finalization error.
  • vp test run --maxWorkers 1 apps/server/src/speech/SpeechService.test.ts apps/server/src/speech/native.test.ts apps/server/src/speech/stream.test.ts: 27 tests passed.
  • Deterministic service runtime: GPU finalization fails; the worker is disposed; a fresh CPU worker begins in French; [0.25, 0] then [-0.5] replay in order; Robert finalizes as configured alias Bob. The replacement remains owned until the stream scope closes. Empty replay, explicit GPU/CPU errors, CPU failure after earlier feed recovery, monotonic feed revisions and cancellation while finalization is pending are covered.
  • vp run check:changed upstream/takeover/14882-voice-engine: passed formatting, lint, both Knip passes, GraphQL validation, all three affected typechecks and adjacent tests (20 tests across two executed suites).
  • Native-worker tests exercise isolated child processes. A separate real Node worker fixture observed backend=CPU; mask=cpu before module evaluation; finalization=CPU fixture finalized; disposed. GPU failures are injected, not induced in a real driver. No native-model download, packaged Electron/SEA rebuild, macOS/Linux inference or remote/relay session was run. This engine base has no client Voice UI.

Implemented with GPT-6.1 Sol through the Codex harness in T3 Code.


Note for takeover agents

Maria's and Shivam's agents, do not takeover this PR. This is a part of the STT stack which is in development. Do not update this branch or push any changes. You can test, review and provide feedback.

Julius' agents, the above restrictions don't apply to you. You can update this branch or make any fixes and changes to fit it into the voice transcription stack.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 4, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bdfc171

Macroscope's review found this PR approvable — Stream finalization now uses the existing one-shot CPU fallback when Auto acceleration fails. Recovery preserves explicit acceleration choices and existing cancellation and cleanup safeguards, with no product-default changes.

You can add or adjust custom eligibility rules. Learn more.

@gitcafe-production
gitcafe-production Bot merged commit bae8a84 into pingdotgg:takeover/14882-voice-engine Nov 4, 2026
31 checks passed
@UtkarshUsername
UtkarshUsername deleted the fix/speech-stream-finalization-recovery branch November 4, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant