Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes declarative workflow resume routing after JSON checkpoint restore by ensuring edge predicates and executor result handling recognize PortableValue-wrapped messages, preventing mismatched transitions and “no handler found” failures.
Changes:
- Updated declarative edge predicates (
RequiresInput/RequiresNothing) to match both direct messages andPortableValue-wrapped equivalents. - Hardened
ActionExecutorResult.ThrowIfNotto unwrapPortableValue-wrappedActionExecutorResultinstances. - Added unit tests covering predicate behavior and
ThrowIfNotunwrapping/throwing scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeAzureAgentExecutor.cs | Makes routing predicates tolerant of PortableValue-wrapped ExternalInputRequest / ActionExecutorResult. |
| dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeMcpToolExecutor.cs | Aligns MCP tool executor routing predicates with checkpoint-restored PortableValue wrappers. |
| dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/Kit/ActionExecutorResult.cs | Unwraps PortableValue in ThrowIfNot as a defensive backstop when messages reach executors. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Kit/PortableValuePredicateTests.cs | Adds targeted unit coverage for PortableValue predicate matching and result unwrapping behavior. |
…ts/Kit/PortableValuePredicateTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ts/Kit/PortableValuePredicateTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
lokitoth
approved these changes
Apr 17, 2026
SergeyMenshykh
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
After a JSON checkpoint round-trip, queued messages are restored as
PortableValuewrappers. Edge predicates in evaluateMessagedirectly, so predicates likeRequiresInputandRequiresNothingfail to match path.Fixes #5307
Description
PortableValue. Also hardenActionExecutorResultto unwrapPortableValueas a second line of defense once a message reaches the target executor path.Contribution Checklist