Description
Declarative workflow runs that include InvokeAzureAgent actions could crash with:
Unhandled workflow failure - #<action_id> (InvokeAzureAgent)
→ System.InvalidOperationException: Sequence contains no elements
The crash is deterministic whenever an invoked agent returns an AgentResponse with zero Messages (e.g., a tool-only
turn where the model emits remote_function_call / mcp_call items without a final assistant text message,
content-filtered responses, or streams that close before the terminal assistant message).
Code Sample
Error Messages / Stack Traces
Package Versions
Microsoft.Agents.AI.Workflows.Declarative
.NET Version
No response
Additional Context
No response
Description
Declarative workflow runs that include InvokeAzureAgent actions could crash with:
Unhandled workflow failure - #<action_id> (InvokeAzureAgent)
→ System.InvalidOperationException: Sequence contains no elements
The crash is deterministic whenever an invoked agent returns an AgentResponse with zero Messages (e.g., a tool-only
turn where the model emits remote_function_call / mcp_call items without a final assistant text message,
content-filtered responses, or streams that close before the terminal assistant message).
Code Sample
Error Messages / Stack Traces
Package Versions
Microsoft.Agents.AI.Workflows.Declarative
.NET Version
No response
Additional Context
No response