You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 56b8307
Browse filesBrowse the repository at this point in the historyBrowse files
Fix multi-step handoff message ordering in non-streaming RunAsync
HandoffAgentExecutor synthesizes a 'Transferred.' tool-result update for
each handoff function call. That update was created without setting
ResponseId, so MessageMerger routed it to the global dangling bucket and
flushed all such tool results at the very end of the merged
AgentResponse, breaking per-step grouping for multi-step handoffs (see
#4544). Streaming output already preserved order because updates are
yielded directly without going through the merger.
Fix: stamp the synthesized update with the same ResponseId as the
preceding agent stream updates so it groups with the agent's other
messages in MessageMerger.
Also adds a regression test that drives the real workflow through
WorkflowHostAgent.RunAsync over a 3-agent handoff chain and asserts the
per-step message ordering of the merged response.
returnnew(newChatMessage(ChatRole.Assistant,[newTextContent("Routing to second agent"),newFunctionCallContent("call1",transferFuncName)]){MessageId="msg-initial"}){ResponseId="resp-initial"};
returnnew(newChatMessage(ChatRole.Assistant,[newTextContent("Routing to third agent"),newFunctionCallContent("call2",transferFuncName)]){MessageId="msg-second"}){ResponseId="resp-second"};
341
+
}),name:"secondAgent",description:"The second agent");
0 commit comments