Skip to content

fix(voice): retain failed detached recordings for retry - #1

Draft
suhaasbadada wants to merge 1 commit into
review-base/33197-4b1d838f48from
fix/preserve-dictation-on-thread-switch-33197
Draft

suhaasbadada wants to merge 1 commit into
review-base/33197-4b1d838f48from
fix/preserve-dictation-on-thread-switch-33197

Conversation

@suhaasbadada

Copy link
Copy Markdown
Owner

Proposal — not an upstream submission

This fork-only draft prepares a recovery follow-up to pingdotgg#33210. It is based on that PR's exact head, 4b1d838f480178847cae839746d8f1a1efe57125, rather than duplicating its thread-ownership fix. Maintainer approval of the recovery/lifetime policy is still pending: pingdotgg#33210 (comment) .

The upstream PR intentionally discards a failed detached recording. This proposal keeps the controller's existing retryable recording while its composer remains mounted, so returning to the originating draft exposes the existing Retry/Cancel controls. It does not keep recording on navigation, insert into another draft, or send a queued message.

Proposed lifetime

  • At most one retained recording in the existing controller; no global registry or persistent audio store.
  • Another thread's composer remains usable for typing/sending. Its microphone explains that the original thread's recording must be retried or discarded first.
  • Retry uses the original prepared transcriber and retained audio, without opening the microphone again. It reads the original draft's current text and selection.
  • Cancel, composer unmount, or a change/revocation of audio consent disposes the retained recording. Failures after unmount retain the upstream PR's discard behavior.
  • Streaming capture also retains its five-minute-bounded PCM buffer. A failed stream retries through the existing batch transcriber rather than a closed stream.
  • Stale-draft and no-speech failures retain the upstream behavior; the shared cross-owner commit guard is unchanged. Mobile does not opt into failed-recording retries and its session/navigation behavior is unchanged.

Verification

Before the fix on the upstream PR head, the four mounted-detachment regression cases fail because deletedRecordings contains blob:env-a instead of retaining it. The streaming retry and streamed-PCM retention regressions also fail before their corresponding changes.

Passed:

vp test run packages/client-runtime/src/voice-input/controller.test.ts apps/web/src/speech/browserPcmCapture.browser.test.ts apps/web/src/speech/useEnvironmentSpeechInput.browser.test.tsx

95 tests pass. Coverage includes original-owner retry, intervening draft edits before retry, repeated A→B→A navigation, no cross-owner insertion/submission, Cancel, consent changes, unmount before and after failure, streamed PCM ownership, and batch fallback after stream failure.

vp run check:changed: passed format, lint, knip, typechecks of seven affected/dependent packages, 171 tests across four selected files, and the React compiler checks.

Not verified: a fresh integrated Browser-panel pass for this narrowed patch. The tools reported “No preview automation host is available” and timed out again after the prescribed status/retry recovery. No real microphone, paid transcription, native desktop, or mobile runtime was used. Earlier recordings on the issue demonstrate the previous local implementation, not this narrower patch and not the upstream PR; they are not offered as validation here.

Written and tested with GPT-6.1 Sol through OpenCode in T3 Code.

@suhaasbadada

Copy link
Copy Markdown
Owner Author

CI status for head 2dfa2ac566fe053823df47236199e1dd1acf1bd5: no remote checks have run. The fork’s Actions API currently reports zero registered workflows, although the source tree contains .github/workflows/ci.yml; this is not a queued or failed CI run. Repository-level Actions are enabled. I have not changed Actions configuration or manually triggered repo-wide CI.

Local verification remains: 95 focused tests pass, and vp run check:changed passes (171 selected tests plus format/lint/knip/typechecks/React compiler). Remote CI and fresh integrated Browser verification remain unverified; this fork-only draft is still awaiting maintainer direction.

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