Skip to content

.NET: Add checkpoint on super step started event: issue #4280 - #4604

Open
Eric Gold (elgold92) wants to merge 19 commits into
microsoft:mainfrom
elgold92:ericgold/CheckpointOnSuperStepStarted
Open

.NET: Add checkpoint on super step started event: issue #4280#4604
Eric Gold (elgold92) wants to merge 19 commits into
microsoft:mainfrom
elgold92:ericgold/CheckpointOnSuperStepStarted

Conversation

@elgold92

@elgold92 Eric Gold (elgold92) commented Mar 10, 2026

Copy link
Copy Markdown

Motivation and Context

Resolves #4280, allowing workflows to resume from checkpoints saved from SuperStepStarted events.

Description

Adds CheckpointInfo? field to the SuperStepStartInfo class, populating this information in the InProcessRunner and InProcStepTracer. Also updates associated unit tests to expect more checkpoints to be created on checkpointed workflows.

Eric Gold added 7 commits March 9, 2026 16:53
Copilot AI review requested due to automatic review settings March 10, 2026 20:11
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Mar 10, 2026
@github-actions github-actions Bot changed the title Add checkpoint on super step started event: issue #4280 .NET: Add checkpoint on super step started event: issue #4280 Mar 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for creating/checkpointing workflow state at the SuperStepStarted boundary so runs can resume from “pre-delivery” checkpoints (addressing #4280), and updates tests accordingly.

Changes:

  • Add a CheckpointInfo? field to SuperStepStartInfo and populate it on SuperStepStartedEvent.
  • Create a checkpoint at the start of each superstep (capturing pre-delivery queued messages) by extending runner state export to accept an override StepContext.
  • Update and expand unit tests to account for the additional checkpoints and validate parent chaining/resume behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/InProcessStateTests.cs Updates expected checkpoint count due to start+end checkpointing per superstep.
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Extends tests to include checkpoints emitted on SuperStepStartedEvent and adds new resume/count assertions.
dotnet/src/Microsoft.Agents.AI.Workflows/SuperStepStartInfo.cs Adds Checkpoint property to expose the checkpoint emitted at superstep start.
dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunnerContext.cs Allows exporting runner state from an alternate StepContext (pre-delivery snapshot).
dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunner.cs Saves a checkpoint before superstep execution and wires it into the started event.
dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcStepTracer.cs Plumbs the start-checkpoint into SuperStepStartedEvent payload.

Comment thread dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/SuperStepStartInfo.cs Outdated
Comment thread dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Outdated
…tParentTests.cs


rename local variable

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 10, 2026 21:07
@elgold92

Copy link
Copy Markdown
Author

Copilot open a new pull request to apply changes based on the comments in this thread. Changes look to be generally minor improvements.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Outdated
Comment thread dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Outdated
Copilot AI review requested due to automatic review settings March 10, 2026 23:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunner.cs
Comment thread dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Outdated
Copilot AI review requested due to automatic review settings March 11, 2026 00:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment thread dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/CheckpointParentTests.cs Outdated
…tParentTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 11, 2026 04:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@Ashutosh0x

Copy link
Copy Markdown

Review: Checkpoint on Super Step Started

This resolves #4280 — enabling checkpoint creation at SuperStepStarted events is essential for workflows that need fine-grained resume points.

Observations

  1. CheckpointInfo on SuperStepStartInfo: Clean approach. Adding the nullable CheckpointInfo? field maintains backward compatibility while surfacing checkpoint data to event handlers.
  2. InProcessRunner + InProcStepTracer: Good that both are updated — this ensures consistency between in-process and distributed execution modes.
  3. Test expectations: You mention updating tests to expect more checkpoints. Are the new checkpoint counts deterministic across different execution orderings? Parallel steps could create checkpoints in varying order.

Suggestion

Consider adding a test that verifies checkpoint restoration from a SuperStepStarted checkpoint specifically (not just creation). This would validate the round-trip: create checkpoint at step start → crash → resume from that checkpoint → verify step re-executes correctly.

This is a solid contribution to workflow reliability!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: [Feature]: Allow checkpoint creation at boundary SuperStepStartedEvent

4 participants