Add Voice Live SDK identification - #50324
Open
Mike Guo (guotuofeng) wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Mike Guo (guotuofeng)
requested review from
a team,
amber-yujueWang,
emilyjiji,
pankopon,
Ryan Hurey (rhurey) and
xitzhang (xitzhang)
as code owners
September 2, 2026 07:48
|
Azure Pipelines: Successfully started running 1 pipeline(s). 35 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Current raw-query decoding uses URLDecoder, which will treat + as space and can mutate existing endpoint query parameter values when converting to the WebSocket URI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds standard Azure SDK identification metadata to Voice Live WebSocket connections by ensuring a consistent SDK User-Agent and by adding an x-ms-client-sdk query parameter (while preserving existing endpoint query params and allowing overrides).
Changes:
- Build a standard Azure SDK user-agent string in
VoiceLiveClientBuilderand propagate it toVoiceLiveAsyncClient. - Add
x-ms-client-sdkto the WebSocket URI and switch query handling to raw-query parsing + explicit encoding/decoding. - Expand unit tests to cover SDK identification, query-parameter preservation, and header override precedence.
File summaries
| File | Description |
|---|---|
| sdk/voicelive/azure-ai-voicelive/src/main/java/com/azure/ai/voicelive/VoiceLiveClientBuilder.java | Constructs the SDK user-agent and sets up default/overridable headers for the client. |
| sdk/voicelive/azure-ai-voicelive/src/main/java/com/azure/ai/voicelive/VoiceLiveAsyncClient.java | Adds SDK identification via x-ms-client-sdk and rewrites query parsing/encoding for WebSocket URI creation. |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/unit/VoiceLiveRequestOptionsClientTest.java | Adds tests for x-ms-client-sdk, query preservation, and request header overrides. |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/unit/VoiceLiveClientBuilderTest.java | Adds tests validating default telemetry user-agent behavior and custom User-Agent override behavior. |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/unit/VoiceLiveAsyncClientTest.java | Updates reflective construction to match the new async client constructor signature. |
| sdk/voicelive/azure-ai-voicelive/CHANGELOG.md | Documents the addition of SDK identification in WebSocket connections. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+304
to
+310
| private static String decodeQueryParameter(String value) { | ||
| try { | ||
| return URLDecoder.decode(value, StandardCharsets.UTF_8.name()); | ||
| } catch (UnsupportedEncodingException e) { | ||
| throw new IllegalStateException("UTF-8 encoding is not supported", e); | ||
| } | ||
| } |
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.
Description
Add the standard Azure SDK identifier to Voice Live WebSocket connections through the
User-Agentheader and thex-ms-client-sdkquery parameter. Preserve client and request-level overrides and existing endpoint query parameters.Ports Azure/azure-sdk-for-python#48848 to the Java SDK.
Testing
mvn -f sdk/voicelive/azure-ai-voicelive/pom.xml -Dtest="com.azure.ai.voicelive.unit.**" test(346 tests passed)git diff --check🤖 Generated with Claude Code