Skip to content

[dotnet-port-fixes] Prefer terminal workflow outputs in collected responses - #583

Merged
gdams merged 1 commit into
mainfrom
dotnet-port-fixes-terminal-workflow-output-e1810b71550ce233
Jul 21, 2026
Merged

[dotnet-port-fixes] Prefer terminal workflow outputs in collected responses#583
gdams merged 1 commit into
mainfrom
dotnet-port-fixes-terminal-workflow-output-e1810b71550ce233

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Aligned workflow-as-agent collection with the upstream .NET fix from microsoft/agent-framework#6212 so non-streaming Collect() responses now prefer designated terminal workflow outputs over intermediate hosted-agent updates when both are present. The Go change stays internal to workflow/agentworkflow: it tracks terminal output-derived updates separately during collection, preserves existing streaming behavior, and adds a regression test covering intermediate hosted-agent outputs followed by a designated terminal workflow output.

Upstream references:

Ported .NET PRs

Breaking Changes

No.

Tests and Examples

  • Ran go test ./workflow/agentworkflow
  • Added TestNew_CollectPrefersTerminalWorkflowOutputOverIntermediateHostedAgentUpdates
  • Updated TestNew_IncludeOutputsInResponse to assert streaming visibility while collected responses prefer terminal workflow outputs

Notes

  • This port intentionally does not broaden Go's existing IncludeOutputsInResponse contract for generic workflow outputs; it only realigns final collected response selection.
  • No exported Go symbols were added or changed.

Generated by .NET to Go Fixes and Test Porting Agent · 1.3K AIC · ⌖ 29.9 AIC · ⊞ 21.7K ·

Closes #563

…ponses

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns Go’s workflow-as-agent “collected” response behavior with the upstream .NET fix so that non-streaming Collect() prefers designated terminal workflow outputs over intermediate hosted-agent update outputs when both occur in the same run. The change is kept internal to workflow/agentworkflow and is covered by a new regression test.

Changes:

  • Track terminal workflow output-derived updates separately during collection and use them for the final merged response when present.
  • Preserve existing streaming behavior (streaming continues to surface both hosted updates and workflow output translations).
  • Add/adjust tests to validate the new selection behavior and streaming visibility expectations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
workflow/agentworkflow/message_merger.go Adds collectedResponseMergeState to maintain both “all updates” and “terminal output only” merge paths for collection.
workflow/agentworkflow/workflow.go Detects terminal workflow outputs and routes collected merge selection to prefer terminal workflow output updates.
workflow/agentworkflow/workflow_test.go Updates streaming assertion and adds a regression test ensuring Collect() prefers terminal workflow output over intermediate hosted-agent updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

Cross-Repo Parity Review — No Issues Found

Scope: workflow/agentworkflow/workflow.go, workflow/agentworkflow/message_merger.go, workflow/agentworkflow/workflow_test.go

This PR is a direct port of the upstream .NET fix (microsoft/agent-framework#6212 / commit d5f2c77) and improves cross-repo behavioral parity rather than introducing a divergence.

Key observations:

  • No exported Go symbols were added or changed — the new collectedResponseMergeState type and all helpers are unexported.
  • The behavioral change (preferring designated terminal workflow outputs over intermediate hosted-agent updates in non-streaming Collect()) aligns Go with the upstream .NET semantics introduced in that fix.
  • Streaming behavior is preserved unchanged, consistent with the upstream implementation.
  • The regression test TestNew_CollectPrefersTerminalWorkflowOutputOverIntermediateHostedAgentUpdates mirrors the scenario covered by the upstream .NET fix.

No parity issues identified. ✅

Generated by Go API Consistency Review Agent for issue #583 · 41.1 AIC · ⌖ 11.8 AIC · ⊞ 28.4K ·

@gdams
gdams added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 53656db Jul 21, 2026
20 checks passed
@gdams
gdams deleted the dotnet-port-fixes-terminal-workflow-output-e1810b71550ce233 branch July 21, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-port-fixes] Prefer terminal workflow outputs in collected responses

3 participants