Files
agent-framework/dotnet/tests/Microsoft.Agents.Workflows.UnitTests/SubstitutionVisitor.cs
T
Jacob Alber 2015f0dc09 .NET: [BREAKING] Support Checkpoint Serialization (#735)
* feat: Support Checkpoint Serialization

* Implements serialization roundtripping for checkpoints.
* Adds support for JSON serialization
* Adds FileSystem-based checkpoint persistence

* fix: Executor State does not deserialize correctly

The StateManager was not properly handling delay-deserialized values.

* Fix PortableValue handling in StateManager (this makes it delegate to PortableValue the uwnrapping)
* Fix UnitTest to actually test checkpoint serialization
* Additional review comment fixes

---------

Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
2025-09-17 19:57:19 +00:00

22 lines
600 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Linq.Expressions;
namespace Microsoft.Agents.Workflows.UnitTests;
internal sealed class SubstitutionVisitor(ParameterExpression parameter, Expression substitution) : ExpressionVisitor
{
private ParameterExpression Parameter => parameter;
private Expression Substitution => substitution;
protected override Expression VisitParameter(ParameterExpression node)
{
if (node.Name == this.Parameter.Name)
{
return this.Substitution;
}
return base.VisitParameter(node);
}
}