Repository navigation
fix(grok-voice): release microphone capture after dictation - #673
Open
rudycelekli wants to merge 2 commits into
Open
rudycelekli wants to merge 2 commits into
rudycelekli wants to merge 2 commits into
Conversation
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
rudycelekli
force-pushed
the
fix/dictation-release-microphone-20261016
branch
from
October 24, 2026 01:57
677c893 to
953134c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The batch dictation client stops its MediaRecorder but never stops the microphone MediaStream tracks. Recording completion therefore leaves capture active, including while a slow or failed transcription upload is pending.
Release all tracks in the dedicated recording stream when onstop runs, before any network await. Explicitly document ownership so an app adapting the example does not shut down a shared voice capture graph. Recorded Blob contents are preserved.
Validation: Node 24 executes the actual TypeScript client snippet with deterministic MediaRecorder/track stand-ins. Unchanged base: two resource-lifetime failures and one successful-transcription control passes. Fixed: all three pass, including pending-upload teardown and network rejection. git diff --check passes. No microphone, vendor account, or live API calls were used.
The success fixture uses a native HTTP Response so the regression suite also composes with #674's response-status handling.
Note
Low Risk
Documentation and test-only changes to the dictation skill example; no production runtime paths modified.
Overview
Fixes a microphone leak in the batch dictation client example in
add-dictation/SKILL.md: onMediaRecorderstop, the sample now stops every track on the recording stream immediately, before the/api/dictationupload, becauseMediaRecorder.stop()alone does not release capture.The comment clarifies that
streamshould be a dedicated mic stream for that recording so integrators do not tear down a shared voice graph.Adds
dictation-capture.test.cjs, which runs the documented TypeScript snippet in Node with mockedMediaRecorder/tracks and asserts tracks are released on success, on pending upload, and on failed fetch, while the recorded blob and transcription insert still work.Reviewed by Cursor Bugbot for commit 677c893. Bugbot is set up for automated code reviews on this repo. Configure here.