Skip to content

[dotnet-code] Route workflow edges by kind - #1176

Merged
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-code-edge-kind-routing-20260922223103-bc1642c1d5f65343
Sep 25, 2026
Merged

Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-code-edge-kind-routing-20260922223103-bc1642c1d5f65343

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Tip

Your pull request is ready to create! 🎉 ✅

Everything is OK—the changes have been pushed to branch dotnet-code-edge-kind-routing-20260922223103-bc1642c1d5f65343. Please review the changes, including any protected files, before creating the pull request.

Create the pull request

The original pull request description is below.


Summary

Route workflow edge delivery through the existing internal kindOfEdge helper instead of re-checking the edge source count in multiple places. This keeps Go's routing structure closer to the .NET Edge.Kind tagged-union shape and makes future workflow ports easier to compare.

.NET Reference

  • dotnet/src/Microsoft.Agents.AI.Workflows/Edge.cs - defines EdgeKind and stores each edge as a kind plus edge data.

Public API and Behavior

No public Go API changed. No intentional behavior change was made.

Tests

  • go test ./workflow/internal/execution ./workflow/inproc ./workflow

Notes

Sampled upstream .NET files from a 40-file dotnet/src search included workflow Edge.cs, workflow Run.cs, and skills AgentSkill.cs. Run.cs already closely matches Go's in-process run event sink/bookmark shape, and AgentSkill.cs would require public-surface changes to align further, so both were rejected. Direct git fetch of the upstream .NET repository was blocked by the environment firewall, so the .NET reference was inspected through the provided read-only GitHub bridge.

Closes #1160

Align edge delivery internals around the existing edge kind helper so future .NET-to-Go workflow ports can map more directly to the .NET Edge.Kind structure. No public API or behavior changes are intended.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 24, 2026 19:26
@github-actions github-actions Bot added area:workflow Changes files in the workflow area size:small At most 30 changed lines across at most 2 files labels Sep 24, 2026

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.

Copilot review overview

🟢 Approval recommended

The focused refactor preserves valid-edge behavior and aligns existing routing branches with centralized classification.

Review effort: Balanced
Findings: None

What changed in this PR

Centralizes workflow edge routing around the existing edge-kind classifier without changing public behavior.

Changes:

  • Computes edge kind once per delivery.
  • Uses it consistently for fan-in buffering and filtering.
File Description
workflow/​internal/​execution/​edgerunner.go Routes delivery logic by kindOfEdge.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added the kind:code Changes production behavior or code label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

API consistency review

Result Scope
aligned internal-only

Changed Go contract

None. The diff touches only the unexported workflow/internal/execution/edgerunner.go. PrepareDeliveryForEdge now computes kind := kindOfEdge(edge) once and reuses it for both kind != fanInEdge checks, replacing the previous len(edge.Connection.SourceIDs) == 1 checks. kindOfEdge classifies an edge as fanInEdge exactly when len(edge.Connection.SourceIDs) > 1, so kind != fanInEdge is logically equivalent to the prior len(edge.Connection.SourceIDs) == 1 condition for all edges reachable by this code path. No exported types, functions, fields, or observable runtime behavior change.

Upstream evidence reviewed

No equivalent evidence review was needed. This PR is an internal Go-only refactor (consolidating a repeated source-count check behind the existing kindOfEdge helper) with no change to public API surface or observable behavior, so no upstream .NET/Python comparison is required per the review scope rules.

Assessment

The change replaces two duplicated len(edge.Connection.SourceIDs) == 1 checks with a single kindOfEdge(edge) computation reused via kind != fanInEdge, which is behaviorally identical (kindOfEdge returns fanInEdge iff len(SourceIDs) > 1). This is purely an internal implementation-detail refactor in an unexported file with no exported API or behavior changes, verified by go build ./... and go test ./workflow/... passing on the PR branch. No cross-repo parity review is warranted.

Generated by Go API Consistency Review Agent for #1176 · copilot · auto · 27 AIC · ⌖ 8.47 AIC · ⊞ 12K · ◷

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Sep 24, 2026
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 5f9da7c Sep 25, 2026
29 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dotnet-code-edge-kind-routing-20260922223103-bc1642c1d5f65343 branch September 25, 2026 05:27
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 kind:code Changes production behavior or code parity-approved Go API consistency review found no parity issues size:small At most 30 changed lines across at most 2 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-code] Route workflow edges by kind

3 participants