Skip to content

Voice agent send voice language locale from the client - #325931

Merged
Megan Rogge (meganrogge) merged 6 commits into
microsoft:mainfrom
mirimadahmed:mirimadahmed-microsoft-send-voice-language-locale
Jul 16, 2026
Merged

Megan Rogge (meganrogge) merged 6 commits into
microsoft:mainfrom
mirimadahmed:mirimadahmed-microsoft-send-voice-language-locale

Conversation

@mirimadahmed

@mirimadahmed Mir (mirimadahmed) commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Voice Code now pins ASR to the client-controlled session language. This change:

  • adds the application-scoped agents.voice.language setting, defaulting to auto
  • sends a canonical, non-empty locale in start_session and resume_session
  • sends { type: 'set_language', language: '<locale>' } when the setting changes during an active session
  • restricts locales to backend-supported language bases and falls back to en-US for invalid or unsupported values
  • keeps language and voice preferences independent

Disconnected language changes are applied on the next start or resume.

Validation

  • npm run typecheck-client
  • focused VoiceClientService tests: 8 passing
  • npm run valid-layers-check
  • changed-file hygiene checks
  • staged npm run precommit
Mir Imad Ahmed added 2 commits July 15, 2026 10:53
Send a required resolved BCP-47 display locale when starting or resuming Voice Mode, and push live language configuration updates without changing the selected voice.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 86a4d71c-0221-42f1-ae95-7ebcc07058ba
Validate canonical locale bases against the backend allowlist and fall back to en-US for unsupported configured or browser locales.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 86a4d71c-0221-42f1-ae95-7ebcc07058ba
Copilot AI review requested due to automatic review settings July 15, 2026 10:46

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 client-controlled locale selection for Voice Mode and synchronizes it with voice backend sessions.

Changes:

  • Registers agents.voice.language with automatic locale detection.
  • Canonicalizes supported locales and sends them on session start, resume, and live updates.
  • Expands voice client tests for locale behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
agentsVoice.contribution.ts Registers the language setting.
voiceClientService.ts (browser) Resolves and sends locales.
voiceSessionController.ts Ensures session contexts have a locale.
voiceClientService.ts (common) Requires display_locale.
voiceClientService.test.ts Tests locale serialization and updates.
Mir Imad Ahmed added 3 commits July 15, 2026 11:53
Present Automatic and each supported backend language through the standard Settings enum control.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 86a4d71c-0221-42f1-ae95-7ebcc07058ba
Track session initialization per WebSocket so pre-session language changes are carried by start or resume instead of sent as live updates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 86a4d71c-0221-42f1-ae95-7ebcc07058ba
Keep the broader ASR locale allowlist for Automatic while restricting explicit selections to languages with native MAI Voice 2 output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 86a4d71c-0221-42f1-ae95-7ebcc07058ba
@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) July 16, 2026 17:54
roblourens
roblourens previously approved these changes Jul 16, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 86a4d71c-0221-42f1-ae95-7ebcc07058ba
auto-merge was automatically disabled July 16, 2026 18:41

Head branch was pushed to by a user without write access

@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) July 16, 2026 19:23
@meganrogge
Megan Rogge (meganrogge) merged commit 7b7ae16 into microsoft:main Jul 16, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

9 participants