Skip to content

Add Voice Live SDK client identification - #48848

Open
Yulin Li (yulin-li) wants to merge 1 commit into
mainfrom
yulin-li/voice-live-identification
Open

Add Voice Live SDK client identification#48848
Yulin Li (yulin-li) wants to merge 1 commit into
mainfrom
yulin-li/voice-live-identification

Conversation

@yulin-li

Copy link
Copy Markdown
Member

Description

Voice Live WebSocket requests currently fall back to aiohttp's generic User-Agent, preventing service telemetry from attributing traffic to the Python SDK. This change generates the standard Azure SDK identifier with UserAgentPolicy, sends it in the User-Agent header, and adds the same value as x-ms-client-sdk on the connection URL for paths where the header is not forwarded.

Caller-provided User-Agent values continue to take precedence, and existing query parameters such as trafficType remain unchanged. Unit coverage verifies the default identifier and package version, custom header override behavior, URL identification, and query preservation.

Tests: python -m pytest --confcutdir=tests\unit tests\unit\test_unit_connection.py -q

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

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

Copilot-Session: a2ae7741-04b4-4da1-8351-1295949976cd
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟡 Changes recommended

The package and SDK identifiers still report version 1.3.0 despite the new 1.3.1 changelog entry.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Azure SDK identification to Voice Live WebSocket connections.

Changes:

  • Adds SDK identification to headers and connection URLs.
  • Preserves custom headers and query parameters.
  • Adds unit coverage and release notes.
File summaries
File Description
aio/_patch.py Generates and sends the SDK identifier.
tests/unit/test_unit_connection.py Tests identification and parameter preservation.
CHANGELOG.md Documents the telemetry change.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@@ -1,5 +1,12 @@
# Release History

## 1.3.1 (Unreleased)
xitzhang (xitzhang) pushed a commit that referenced this pull request Sep 3, 2026
… identification fix

- _realtime.py/aio: add User-Agent + x-ms-client-sdk identification (ports fix from
  azure-ai-voicelive PR #48848), with case-insensitive header collision guard so a
  caller-supplied extra_headers User-Agent (any casing) is not duplicated
- test_realtime_client(_async).py: add regression tests for identification headers
  and case-insensitive override behavior
- tests/agents/test_voice_agent_realtime_live(_async).py: new live-only tests for
  voice agent realtime session lifecycle, text-to-audio/transcript turns, and
  function tool-call round trip
- tests/agents/test_voice_agent_conversations(_async).py: new recorded tests for
  beta.agent_endpoint_conversations REST surface, with a live-only setup step to
  obtain a sanitized conversation_id for playback
- assets.json: pin new recordings via test-proxy push (tag ..._d354d861da)
- test-resources.bicep/test-resources-post.ps1/tests.yml: new live-test CI
  infrastructure (Foundry account/project + gpt-realtime model deployment),
  following the azure-ai-voicelive package pattern
- CHANGELOG.md: document the identification fix under Bugs Fixed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants