Skip to content

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

Closed

Description

@github-actions

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.


Note

GitHub Actions is not permitted to create or approve pull requests in this repository.

The changes have been pushed to branch dotnet-code-edge-kind-routing-20260922223103-bc1642c1d5f65343 and are ready to review.

To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (43 of 47 lines)
From 7bf3fa8ee6fef9f2b39a78897b8873168cd6b880 Mon Sep 17 00:00:00 2001
X-GH-AW-Base-Commit: 98d5c26075ed5816779b4fa48e142dacae9c61e4
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Tue, 22 Sep 2026 22:31:03 +0000
Subject: [PATCH] [dotnet-code] Route workflow edges by kind

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>
---
 workflow/internal/execution/edgerunner.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/workflow/internal/execution/edgerunner.go b/workflow/internal/execution/edgerunner.go
index c04ab37..7b5a840 100644
--- a/workflow/internal/execution/edgerunner.go
+++ b/workflow/internal/execution/edgerunner.go
@@ -211,6 +211,7 @@ func (em *EdgeRunner) PrepareDeliveryForEdge(ctx context.Context, edge workflow.
 		span.SetDeliveryStatus(observability.DeliveryStatusDroppedConditionFalse)
 		return nil, nil
 	}
+	kind := kindOfEdge(edge)
 	targetIDs := selectedTargetIDs(edge, envelope)
 	if len(targetIDs) == 0 {
 		span.SetDeliveryStatus(observability.DeliveryStatusDroppedTargetMismatch)
@@ -218,7 +219,7 @@ func (em *EdgeRunner) PrepareDeliveryForEdge(ctx context.Context, edge workflow.
 	}
 
 	var envelopes []*MessageEnvelope
-	if len(edge.Connection.SourceIDs) == 1 {
+	if kind != fanInEdge {
 		envelopes = []*MessageEnvelope{envelope}
 	} else {
 		// Stateful edge - track source messages.
@@ -243,7 +244,7 @@ func (em *EdgeRunner) PrepareDeliveryForEdge(ctx context.Context, edge workflow.
 		span.SetDeliveryStatus(observability.DeliveryStatusDroppedTargetMismatch)
 		return nil, nil
 	}
-	if len(edge.Connection.SourceIDs) == 1 {
+	if kind != fanInEdge {
 		// Filter targets that can handle the message type.
 		runtimeType, err := em.messageRuntimeType(ctx, envelope)
 		if err 
... (truncated)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by .NET-to-Go Code Portability Refactoring Agent · copilot · gpt55 · 81.8 AIC · ⌖ 12.7 AIC · ⊞ 14.5K · ◷

Activity

  1. michelle-clayton-work commented on Sep 24, 2026

    @michelle-clayton-work
    Contributor

    Pull request #1176 is linked to this issue and will close it when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions