Skip to content

.NET: Workflow Host-as-Agent can improperly reorder messages in history and when running non-streaming #5720

Closed

Description

@lokitoth

When using a Workflow with tool calls and responses wrapped in .AsAgent(), outgoing messages are topologically sorted and merged using the MessageMerger. This does not behave correctly in the presence of ToolCalls/Responses in Handoff workflows, resulting in unexpected message ordering.

This is somewhat hidden when running using WorkflowHostAgent.RunStreamingAsync() because the outgoing enumeration yields the events in raw order, rather than in merged order. History still uses merged order, and this is directly visible when running using WorkflowHostAgent.RunAsync()

Activity

  1. changed the title [-]Workflow Host-as-Agent can improperly reorder messages in history and when running non-streaming[/-] [+].NET: Workflow Host-as-Agent can improperly reorder messages in history and when running non-streaming[/+] on May 8, 2026
  2. moved this from In Progress to Done in Agent Frameworkon Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .NetworkflowsUsage: [Issues, PRs], Target: Workflows

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions