[dotnet-code] Consolidate delivery mapping construction - #988
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
Small internal refactor with straightforward call-site updates and no apparent behavior change or API impact.
Pull request overview
Centralizes internal DeliveryMapping construction behind unexported helper functions and reuses them across edge, input, and response delivery paths in workflow/internal/execution, aligning the Go structure with the referenced .NET shape while keeping behavior unchanged.
Changes:
- Added unexported constructor helpers
newDeliveryMappingandnewSingleDeliveryMappingfor consistentDeliveryMappinginitialization. - Updated
EdgeRunnerdelivery preparation methods to use the new helpers instead of inline struct literals.
File summaries
| File | Description |
|---|---|
| workflow/internal/execution/run.go | Introduces unexported helpers to construct DeliveryMapping instances consistently. |
| workflow/internal/execution/edgerunner.go | Switches edge/input/response delivery paths to use the centralized constructors. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
…227-c60872f5139c3e3b
|
Scope: internal-only Changed Go contract: None — Upstream evidence reviewed: Result: out of scope — this is a pure internal refactor (unexported helpers only) with no observable behavior, API, or default change. No parity issues to report. Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "api.github.com"
- "github.com"See Network Configuration for more information.
|
Summary
Centralized internal
DeliveryMappingconstruction behind unexported helpers and reused them in the workflow edge, input, and response delivery paths. This mirrors the corresponding .NETDeliveryMappingshape where construction is centralized, making future .NET-to-Go ports easier to compare without changing runtime behavior..NET Reference
dotnet/src/Microsoft.Agents.AI.Workflows/Execution/DeliveryMapping.cs- centralizes delivery mapping initialization through constructors for single and multiple envelopes/targets.Public API and Behavior
No public Go API changed. No intentional behavior change was made.
Tests
go test ./workflow/internal/executionNotes
Rejected candidates from the random sample:
dotnet/src/Microsoft.Agents.AI.Workflows/Execution/StateScope.csmapped to Go state internals that were already structurally close and risked behavior-sensitive churn around nil/delete semantics.dotnet/src/Microsoft.Agents.AI.Abstractions/FeatureIndex.csdid not have a useful corresponding Go internal abstraction to clean up without inventing a feature placeholder.dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Extensions/DataValueExtensions.csmapped to declarative conversion logic not clearly present in this Go checkout, so changing it would have been speculative.Closes #979