.NET: Fix declarative resume edge predicates to recognize both direct and PortableValue-wrapped forms after checkpoint restore (#5323)

* Fix declarative workflows edge predicates after checkpoint restore

* Update test names to  make them clearer and more discoverable.

* Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Kit/PortableValuePredicateTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Kit/PortableValuePredicateTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Peter Ibekwe
2026-04-17 15:18:15 +00:00
committed by GitHub
co-authored by Copilot
parent b03cb324d5
commit c85d24da44
4 changed files with 206 additions and 4 deletions
@@ -46,12 +46,14 @@ internal sealed class InvokeMcpToolExecutor(
/// <summary>
/// Determines if the message indicates external input is required.
/// </summary>
public static bool RequiresInput(object? message) => message is ExternalInputRequest;
public static bool RequiresInput(object? message) =>
message is ExternalInputRequest || (message is PortableValue pv && pv.IsType(out ExternalInputRequest? _));
/// <summary>
/// Determines if the message indicates no external input is required.
/// </summary>
public static bool RequiresNothing(object? message) => message is ActionExecutorResult;
public static bool RequiresNothing(object? message) =>
message is ActionExecutorResult || (message is PortableValue pv && pv.IsType(out ActionExecutorResult? _));
/// <inheritdoc/>
protected override bool EmitResultEvent => false;