Repository navigation
[dotnet-code] Extract portable message unwrap helper - #1108
Quim Muntal (qmuntal) merged 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Pass PortableValue by pointer or otherwise propagate cache mutations to preserve existing behavior.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Extracts portable message unwrapping into an unexported workflow router helper.
Changes:
- Replaces inline unwrapping with
unwrapPortableMessage. - Preserves registered and polymorphic routing paths.
- No public API changes.
| File | Summary |
|---|---|
workflow/route.go |
Extracts portable message unwrapping. Moderate issue: passing PortableValue by value prevents cache updates from propagating. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } else if value := pvalue.Any(); value != nil && pvalue.TypeID.MatchPolymorphic(reflect.TypeOf(value)) { | ||
| msg = value | ||
| } | ||
| msg = mr.unwrapPortableMessage(pvalue) |
This comment has been minimized.
This comment has been minimized.
|
Copilot address PR feedback |
Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
|
Scope: internal-only Changed Go contract: None. Upstream evidence reviewed: Result: aligned (out of scope for parity concerns) Summary: This PR (1) extracts the existing portable-value unwrap logic in
|

Tip
Your pull request is ready to create! 🎉 ✅
Everything is OK—the changes have been pushed to branch
dotnet-code-message-router-unwrap-20260918222921-0aed06660944a6f8. 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
Extracts the workflow message router's
PortableValueunwrapping into a small unexported helper. This keeps Go routing behavior the same while making the route flow more structurally similar to the .NETMessageRouter.RouteMessageAsyncconversion step, which should make future .NET-to-Go comparisons easier..NET Reference
dotnet/src/Microsoft.Agents.AI.Workflows/Execution/MessageRouter.cs- unwrapsPortableValuemessages to the registered runtime type before handler lookup.Public API and Behavior
No public Go API changed. No intentional behavior change was made.
Tests
gofmt -w workflow/route.gogo test ./workflowNotes
Rejected candidates:
dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Interpreter/WorkflowModel.cs- no current Go declarative workflow counterpart was found, so a structural cleanup would be speculative.dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.Mcp.UnitTests/DefaultMcpToolHandlerTests.cs- nearest Go MCP areas are provider/tool-facing and broader than the requested tiny portability cleanup.[dotnet-code]PR found: [dotnet-port-api] Add compaction-backed history provider #1092, covering compaction rather than this workflow router area. Two lower-integrity PR search results were filtered by the environment and were not inspected.The upstream .NET
git fetchwas blocked by the environment network boundary, so the .NET reference was sampled/read via the read-only GitHub MCP CLI instead.Closes #1106