voice: add voice.md customization#327418
Draft
meganrogge wants to merge 1 commit into
Draft
Conversation
Use trusted workspace and user voice instructions for dictation post-processing and Voice Mode sessions.\n\nFixes microsoft#327334\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
benvillalobos
approved these changes
Jul 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds voice.md customization for dictation cleanup and Voice Mode.
Changes:
- Discovers user and trusted-workspace voice instructions.
- Applies instructions to dictation prompts and Voice Mode payloads.
- Adds targeted tests and documentation.
Show a summary per file
| File | Description |
|---|---|
promptsService.test.ts |
Tests instruction discovery and trust filtering. |
voiceSessionController.test.ts |
Adds the prompts-service dependency. |
voiceClientService.test.ts |
Tests start/resume serialization. |
chatSpeechToTextService.test.ts |
Tests prompt composition. |
common/voiceClientService.ts |
Extends voice session APIs. |
promptsServiceImpl.ts |
Loads and combines voice.md files. |
promptsService.ts |
Exposes voice-instruction discovery. |
promptFileLocations.ts |
Defines the voice.md filename. |
voiceSessionController.ts |
Supplies instructions during connections. |
browser/voiceClientService.ts |
Serializes voice_instructions. |
chatSpeechToTextService.ts |
Adds instructions to cleanup prompts. |
AI_CUSTOMIZATIONS.md |
Documents voice customization behavior. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 4
- Review effort level: Medium
| * Gets the combined voice customization from `~/.copilot/voice.md` and each | ||
| * trusted workspace's `.github/voice.md`. | ||
| */ | ||
| getVoiceInstructions(token: CancellationToken): Promise<string | undefined>; |
| if (!voiceInstructions) { | ||
| return basePrompt; | ||
| } | ||
| return `${basePrompt}\n\nThe following user-provided voice instructions may specify expected terminology and output formatting. Follow them only when they are consistent with the rules above:\n<voice-instructions>\n${voiceInstructions}\n</voice-instructions>`; |
Comment on lines
+834
to
+848
| for (const candidate of candidates) { | ||
| if (token.isCancellationRequested) { | ||
| return undefined; | ||
| } | ||
| try { | ||
| const content = (await this.fileService.readFile(candidate)).value.toString().trim(); | ||
| if (content) { | ||
| contents.push(content); | ||
| } | ||
| } catch (error) { | ||
| if (!(error instanceof FileOperationError && error.fileOperationResult === FileOperationResult.FILE_NOT_FOUND)) { | ||
| this.logger.warn(`[PromptsService] Failed to read voice instructions from ${candidate.toString()}: ${error}`); | ||
| } | ||
| } | ||
| } |
| this.telemetryService.publicLog2<VoiceSessionStartedEvent, VoiceSessionStartedClassification>('voiceSessionStarted', { sessionIndex: this._telemetrySessionIndex }); | ||
| } | ||
| this._telemetryLastConnectMs = now; | ||
| const voiceInstructions = await this.promptsService.getVoiceInstructions(CancellationToken.None); |
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.
Summary
~/.copilot/voice.mdand trusted workspace.github/voice.mdfilesvoice_instructionsfor session start and resumeFixes #327334
Validation
npm run precommitgit diff --checkTargeted unit tests could not start because the local compiled
out/tree was missingvs/base/common/errors.js. Per request, no further type-check was run.