[dotnet-port-fixes] Align workflow message ordering with .NET#538
[dotnet-port-fixes] Align workflow message ordering with .NET#538michelle-clayton-work wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Ports the upstream .NET workflow-hosting fix to Go by adjusting workflow/agentworkflow response/message merge behavior so merged workflow messages preserve first-seen ordering (instead of being re-sorted by timestamps) and identifierless update segments stay in-place.
Changes:
- Preserve first-seen response/message ordering by removing timestamp-based re-sorting and tracking message-state order explicitly during merge.
- Keep identifierless (missing
MessageID) segments in their original contiguous position rather than collecting them at the end. - Add parity-focused tests covering first-seen ordering, contiguous response grouping, function call/result ordering, and identifierless segment handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| workflow/agentworkflow/message_merger.go | Reworks merge state tracking to preserve first-seen ordering and avoid overwriting per-message CreatedAt during stamping. |
| workflow/agentworkflow/message_merger_test.go | Adds ordering/parity tests to lock in the intended merge ordering semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func messagesWithCreatedAt(response *agent.Response) []*message.Message { | ||
| if response == nil { | ||
| return nil | ||
| } | ||
| messages := make([]*message.Message, 0, len(response.Messages)) |
This comment has been minimized.
This comment has been minimized.
|
@copilot respond to PR comments |
… stamping Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Fixed in the latest commit. Changed |
Cross-Repo API Consistency ReviewResult: No parity issues — out of scope for cross-SDK consistency review. This PR only modifies internal, unexported implementation details in
The PR is a direct port of the upstream .NET fix (microsoft/agent-framework#7123) and correctly preserves semantic alignment with the .NET ordering behavior (first-seen ordering, contiguous response grouping, identifierless segment handling). No Python or .NET public contract divergence is introduced.
|
Summary
Align
workflow/agentworkflowresponse merging with the upstream .NET workflow-hosting fix from microsoft/agent-framework#7123 (05834b56e31f941e90e3337eb0f09d1a6ad8ee88).The Go port keeps workflow-agent message ordering in first-seen order by:
CreatedAtvalues when stamping merged messages.It also adds focused parity tests for the ordering cases that regressed upstream: contiguous response ordering, function call/result ordering, and identifierless segment handling.
Ported .NET PRs
Upstream commit:
05834b56e31f941e90e3337eb0f09d1a6ad8ee88Breaking Changes
No.
Tests and Examples
go test ./workflow/agentworkflow/...workflow/agentworkflow/message_merger_test.goparity coverage for first-seen ordering, contiguous response grouping, function call/result ordering, and identifierless segmentsNotes
Closes #502