Skip to content

voice: add voice.md customization#327418

Draft
meganrogge wants to merge 1 commit into
microsoft:mainfrom
meganrogge:agents/add-voice-md-for-dictation-mode
Draft

voice: add voice.md customization#327418
meganrogge wants to merge 1 commit into
microsoft:mainfrom
meganrogge:agents/add-voice-md-for-dictation-mode

Conversation

@meganrogge

Copy link
Copy Markdown
Collaborator

Summary

  • discover voice customization from ~/.copilot/voice.md and trusted workspace .github/voice.md files
  • append voice guidance to the existing dictation post-processing system prompt without replacing its safety and fidelity rules
  • send the combined guidance to the Voice Mode backend as voice_instructions for session start and resume
  • cover instruction discovery, dictation prompt composition, and websocket payload serialization

Fixes #327334

Validation

  • npm run precommit
  • targeted hygiene checks
  • git diff --check

Targeted unit tests could not start because the local compiled out/ tree was missing vs/base/common/errors.js. Per request, no further type-check was run.

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>
Copilot AI review requested due to automatic review settings July 24, 2026 23:24
@meganrogge meganrogge self-assigned this Jul 24, 2026
@meganrogge meganrogge added this to the 1.132.0 milestone Jul 24, 2026
@meganrogge
meganrogge marked this pull request as draft July 24, 2026 23:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
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.

Add voice.md for dictation and voice mode

3 participants