dictation: Cap recording and finalization duration - #333846
Merged
Megan Rogge (meganrogge) merged 2 commits intoSep 1, 2026
Merged
Conversation
Stop active dictation after 20 minutes and bound NeMo finalization to eight seconds, preserving the streamed transcript when finalization stalls. Fixes #333832. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Megan Rogge (meganrogge)
September 1, 2026 19:42
View session
Megan Rogge (meganrogge)
enabled auto-merge (squash)
September 1, 2026 19:42
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
NeMo cancellation can race a subsequent session, and the duration watchdog can be scheduled when recording never started.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.ts — Fire-and-forgetting cancellation lets _stopAndTranscribe expose Idle and permit a new NeMo… |
|
src/vs/workbench/contrib/chat/browser/speechToText/dictationSession.ts — start() has several normal early-return paths (disabled setting, lost entitlement, unsupported… |
What changed in this PR
Adds bounded recording and finalization for dictation sessions.
Changes:
- Stops dictation automatically after 20 minutes with an accessible announcement.
- Adds an eight-second NeMo finalization timeout with transcript fallback.
- Adds regression tests for both limits.
| File | Description |
|---|---|
dictationSession.ts |
Adds the recording-duration watchdog. |
chatSpeechToTextService.ts |
Adds bounded NeMo finalization and cancellation. |
dictationSession.test.ts |
Tests automatic stopping. |
chatSpeechToTextService.test.ts |
Tests finalization timeout fallback. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Wait for timed-out NeMo stop and cancellation work before starting another local session, and only schedule the duration cap after recording actually starts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 1, 2026
Megan Rogge (meganrogge)
deleted the
agents/github-app-repo-folder-exploration
branch
September 1, 2026 20:31
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.


Fixes #333832
What changed
Alignment with GitHub app
The GitHub app uses an eight-second watchdog after the user requests a stop: if the backend never emits its final
stoppedevent, the composer finishes with the transcript accumulated so far instead of remaining stuck in the transcribing state. VS Code already had a four-second equivalent for MAI, but NeMo had no bound. This change applies the GitHub app pattern to NeMo while retaining VS Code’s existing MAI timeout.The 20-minute recording cap is separate from that finalization watchdog. It prevents either backend from keeping the microphone open indefinitely; once reached, VS Code follows the normal finalization path so dictated text is preserved.
Validation
npm run compile-clientnpm run hygiene./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/dictationSession.test.ts --run src/vs/workbench/contrib/chat/test/browser/chatSpeechToTextService.test.ts(27 passing)