MCP tool completed event was issued twice when a mcp call is done.
- Package Name: azure-ai-agent
- Package Version: 1.2.0b3
- Operating System: Windows
- Python Version: 3.11.9
Describe the bug MCP tool completed event was issued twice when a MCP call is done. Below is the output by the mcp call sample program, https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_mcp.py.
We can see there are two mcp call step completed events.
RunStepDeltaChunk received. ID: step_Kqeuu8EuBUR8PCgzjDtQrlSU. RunStepDeltaChunk received. ID: step_Kqeuu8EuBUR8PCgzjDtQrlSU. ThreadRun status: RunStatus.REQUIRES_ACTION Approving tool call: {'id': 'call_iPejadoUkwLXf42HhGxNtJBA', 'type': 'mcp', 'arguments': '{"query":"Azure CLI command to list Azure Container Apps"}', 'name': 'microsoft_docs_search', 'server_label': 'msdocs'} tool_approvals: [{'tool_call_id': 'call_iPejadoUkwLXf42HhGxNtJBA', 'approve': True, 'headers': {}}] Stream completed. RunStep type: RunStepType.TOOL_CALLS, Status: RunStepStatus.COMPLETED MCP Tool calls: Tool Call ID: call_iPejadoUkwLXf42HhGxNtJBA Type: mcp
ThreadRun status: RunStatus.QUEUED ThreadRun status: RunStatus.IN_PROGRESS RunStepDeltaChunk received. ID: step_Kqeuu8EuBUR8PCgzjDtQrlSU. RunStep type: RunStepType.TOOL_CALLS, Status: RunStepStatus.COMPLETED MCP Tool calls: Tool Call ID: call_iPejadoUkwLXf42HhGxNtJBA Type: mcp
To Reproduce Steps to reproduce the behavior: Use the sample program with a MCP server (https://learn.microsoft.com/api/mcp), https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_iteration_with_mcp.py
Expected behavior A clear and concise description of what you expected to happen. MCP call completed step event should be issued only once.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @luigiw @needuv @paulshealy1 @singankit.
looks like the same issue reported in #42700
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dargilco @glharper @howieleung @jhakulin @nick863 @trangevi.
@cqzheng The bug mentioned above has been fixed, could you recheck this issue and let us know if you're still experiencing this behavior?
@glharper Thanks!!! May I ask when I can verify the fix on a new release? I experienced the issue on 1.1.0b3 but didn't see a new release after it.
@cqzheng Current preview version is 1.2.0b3, but I believe this fix is service side, not in the SDK. Even so, best to use the latest.
@glharper I tried 1.2.0b3 SDK and still experienced the issue.
@apryiomka FYI