Skip to content

[dotnet-port-fixes] Deliver to repeated fan-out targets once - #1336

Merged
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-port-fixes/fanout-dedupe-a3836381b0dc9192
Oct 29, 2026
Merged

Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-port-fixes/fanout-dedupe-a3836381b0dc9192

Conversation

@microsoft-agent-framework-for-go

Copy link
Copy Markdown
Contributor

Summary

A fan-out edge delivered a message once per entry when its Assigner (or sink list) named the same target more than once, so a target could run twice on one message. selectedTargetIDs in workflow/internal/execution/edgerunner.go now drops repeated IDs, keeping the order in which each target is first named. This matches upstream FanOutEdgeRunner, which applies Distinct(StringComparer.Ordinal) to the resolved target IDs. #706 fixed only the SwitchBuilder per-case path; the runtime path was still unguarded.

Ported .NET PRs

Breaking Changes

No. Repeated targets now run once, which is the intended contract.

Tests and Examples

I added TestPrepareDeliveryForFanOutEdge_AssignerRepeatedTargetsDeliveredOnce in workflow/internal/execution/edgerunner_test.go. No example changes were needed. gofmt is clean and go test ./workflow/... passes.

Notes

Generated by .NET to Go Fixes and Test Porting Agent · copilot · auto · 31.5 AIC · ⌖ 0.698 AIC · ⊞ 4.9K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added area:workflow Changes files in the workflow area parity-approved Go API consistency review found no parity issues labels Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

API consistency review

Result Scope
aligned user-visible behavior

Changed Go contract

selectedTargetIDs (workflow/internal/execution/edgerunner.go) now de-duplicates fan-out targets, keeping first-named order, before applying the envelope target filter. No exported API change.

Upstream evidence reviewed

Implementation Source Contract checked
.NET FanOutEdgeRunner.ChaseEdgeAsync targetIds.Distinct(StringComparer.Ordinal) before the IsValidTarget filter; no opt-in gate

Assessment

Upstream applies an unconditional ordinal Distinct that preserves first-named order, then filters by the envelope target. Go now does the same (exact-match dedupe, first-occurrence order, envelope filter). Neither side has an option or default to disable it, so enablement matches. No parity issues found.

Generated by Go API Consistency Review Agent for #1336 · copilot · auto · 16.4 AIC · ⌖ 0.615 AIC · ⊞ 4.9K · ◷

@qmuntal
Quim Muntal (qmuntal) marked this pull request as ready for review October 29, 2026 05:02
Copilot AI balanced review requested due to automatic review settings October 29, 2026 05:02
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner October 29, 2026 05:02

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.

🟢 Approval recommended

There are no active review issues for the runtime fan-out deduplication change.

No open issues 🎉

What changed in this PR

This PR prevents duplicate delivery to repeated fan-out targets at runtime, extending the earlier SwitchBuilder-specific fix in #706.

Changes:

  • Deduplicates resolved target IDs while preserving first-occurrence order and target filtering.
  • Adds a regression test for an assigner that selects the same targets repeatedly.
File Description
workflow/​internal/​execution/​edgerunner.go Deduplicates selected target IDs so each target receives the message once.
workflow/​internal/​execution/​edgerunner_test.go Adds coverage for repeated target selections from an assigner.

Review effort: Balanced

Merged via the queue into main with commit 5ab931d Oct 29, 2026
24 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dotnet-port-fixes/fanout-dedupe-a3836381b0dc9192 branch October 29, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workflow Changes files in the workflow area parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants