Skip to content

Add realtime voice agent WebSocket tests - #50409

Open
Mike Guo (guotuofeng) wants to merge 2 commits into
myguo/voice-agents-corefrom
myguo/voice-websocket-tests
Open

Add realtime voice agent WebSocket tests#50409
Mike Guo (guotuofeng) wants to merge 2 commits into
myguo/voice-agents-corefrom
myguo/voice-websocket-tests

Conversation

@guotuofeng

@guotuofeng Mike Guo (guotuofeng) commented Sep 11, 2026

Copy link
Copy Markdown
Member

Description

Fourth PR in stack #50413, based on #50408. Adds deterministic protocol/model tests and local WS/WSS loopback coverage for the production implementation below it.

Coverage includes authentication, headers, query options, typed events, text/audio/tool operations, ordering, buffering, malformed frames, close behavior, rejected handshakes, voice-definition serialization, and updated conversation/memory playback tests. Local TLS certificate fixtures are test-only.

Stack:

Validation: Maven passed all six changed test classes: ConversationsAsyncTests, ConversationsTests, MemoryStoresAsyncTests, MemoryStoresTests, VoiceAgentWebSocketSessionTests, and VoiceAgentDefinitionSerializationTests.

All SDK Contribution checklist:

General Guidelines and Best Practices

  • Title is clear and informative.
  • The PR has one focused commit.

Testing Guidelines

  • Pull request contains focused test coverage.

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

Moderate WebSocket coverage and voice-definition round-trip assertion gaps remain.

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

Pull request overview

Adds deterministic WebSocket/WSS loopback tests and voice-agent serialization coverage for Azure AI Agents.

Changes:

  • Tests protocol, authentication, headers, options, events, operations, errors, and close behavior.
  • Adds voice-definition round-trip tests and local TLS fixtures.
  • Updates conversation and memory-store playback tests.
File summaries
File Summary
sdk/ai/azure-ai-agents/src/test/resources/websocket-localhost-key.pem Test TLS private-key fixture.
sdk/ai/azure-ai-agents/src/test/resources/websocket-localhost-cert.pem Test TLS certificate fixture.
sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/VoiceAgentWebSocketSessionTests.java WebSocket and loopback tests. Moderate findings: missing custom-header assertion (3 votes), missing sync function-call response/order assertions (3 votes), and missing bounded-queue/outstanding-send coverage (2 votes).
sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/VoiceAgentDefinitionSerializationTests.java Voice-definition serialization tests. Moderate findings: incomplete nested round-trip assertions (2 votes) and insufficient end_conversation subtype verification (1 vote).
sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresTests.java Updated memory-store names.
sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresAsyncTests.java Updated asynchronous memory-store names.
sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ConversationsTests.java More robust message selection.
sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ConversationsAsyncTests.java More robust asynchronous message selection.
Review details

Suppressed comments (1)

sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/VoiceAgentDefinitionSerializationTests.java:76

  • The serialized value is VoiceAgentEndConversationSystemTool, but this assertion accepts any VoiceAgentSystemTool. Since VoiceAgentTool.fromJson dispatches the system subtype by name, checking only the base class will miss a broken discriminator and fail to verify that end_conversation survives the round trip.
        assertInstanceOf(VoiceAgentSystemTool.class, voice.getTools().get(1));
  • Files reviewed: 8/8 changed files
  • Comments generated: 4
  • Review effort level: Lite

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

@guotuofeng
Mike Guo (guotuofeng) removed this pull request from stack #50411 September 11, 2026 01:13
@guotuofeng
Mike Guo (guotuofeng) added this pull request to stack #50413 September 11, 2026 01:13
@azure-pipelines

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

1 similar comment
@azure-pipelines

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

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.

2 participants