Skip to content

feat(speech): live dictation in the composer (#845) - #865

Closed
currentbits wants to merge 1 commit into
coder/fork-execute-this-live-speech-to-text-de-e47061from
coder/fork-execute-this-live-speech-to-text-de-4246d9
Closed

currentbits wants to merge 1 commit into
coder/fork-execute-this-live-speech-to-text-de-e47061from
coder/fork-execute-this-live-speech-to-text-de-4246d9

Conversation

@currentbits

Copy link
Copy Markdown
Owner

PR 3 of live speech-to-text (#845). Stacked on #858 (IPC + squash-merged manager from #863).

Cherry-picked 576e00dc onto current #858 head 3db11318 so this is one commit, not a replay of the pre-squash manager SHA.

  • Mic pill next to attach
  • First click while missing: confirm exact download size (~700 MB / 699,872,960 bytes); confirm calls download(), does not open the mic
  • Ready click: getUserMedia then speech.start
  • AudioWorklet 16 kHz mono PCM16, 100 ms / seq
  • Renderer concatenates delta suffixes; transcript replaces the provisional range
  • Cancel/restore on Escape, thread switch, archive, unmount

Does not yet implement src/speechSink.ts from the later spec erratum (#168/#855). Capture still lives in Composer. Follow-up if we want the singleton before packaging.

Tests: composer suite 110/110 locally.

Follow-up: packaging (runtime tree, plist, licenses, CI doctor+WAV).

Mic pill next to attach, user-confirmed ~700 MB download, AudioWorklet
16 kHz PCM16, concatenated deltas, and cancel/restore on Escape, thread
switch, archive, and unmount.
@currentbits
currentbits changed the base branch from main to coder/fork-execute-this-live-speech-to-text-de-e47061 September 3, 2026 13:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-03T13:08:36.361115Z fc34aa9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits

Copy link
Copy Markdown
Owner Author

Base is coder/fork-execute-this-live-speech-to-text-de-e47061 (#858, which already includes squash-merged #863). One commit fc34aa92.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

const capture = await startSpeechCapture({

P1 Badge Arm speech permission before requesting the microphone

startSpeechCapture() calls getUserMedia() before api.start(), but the installed Electron permission handlers deny media until speech.start() sets recordingRequested. Consequently, an Electron permission request/check rejects the initial mic click before execution can reach api.start(). Reserve the speech session before requesting the microphone and cancel it if capture fails, or establish a separate explicit permission-arming step.


emit({ transcript: text });

P1 Badge Publish the ready state after the final transcript

During a normal stop, this emits while state is still "stopping" and active still exists, then closes the socket without another emission. Composer clears its local dictating flag when the transcript arrives but retains speech.state === "stopping"; onMicClick only starts from ready or recording, so every subsequent mic click does nothing until a status refetch or reload. Close/reset the session before emitting the final transcript or emit a ready snapshot afterward.


if (status.state === "error") {

P2 Badge Handle operational error pushes after the state returns ready

When the sidecar exits during recording, endRecording() closes active before taking the snapshot, so deriveState() produces "ready" because the model is still installed while the push still carries error: "Speech sidecar exited.". Restricting recovery to status.state === "error" therefore leaves the textarea read-only, the microphone capture running, and the failure unreported until the user manually stops. Treat an error-bearing status as terminal for an active snapshot, or make the manager publish an error state for this path.


const out = fs.createWriteStream(partialPath);

P2 Badge Catch write-stream error events during model download

If the filesystem rejects a write during the roughly 700 MB download, such as on ENOSPC, WriteStream emits an error event in addition to invoking the write callback. Because this stream has no error listener, that event escapes through the process-level crash guard and produces an internal-error report instead of remaining within the download's normal failure path. Attach an error handler and route it into the existing cleanup and status handling.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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