MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1
Demo310 — Checkpoint Resume
CreateInMemory remains in the same process after graph reconstruction. The pending request is re-emitted; PrepareApprovalV1 must not run on resume. This program does not restore a checkpoint after process exit, contrary to the historical catalogue summary.
Objectives
- Reconstruct the graph and restore an in-memory checkpoint within the same process.
Prepare the program
No model, embeddings, container or secret required. Start at the root of the complete distribution. Preserve shared projects and configuration files. Some historical prompts and labels in Demo260–290 remain French in public code; commands and identifiers match this revision.
dotnet build BaseTechnique.slnx -m:1 -c Release| Project | Role |
|---|---|
| demos/Demo310_CheckpointResume/Demo310.App.csproj | App |
| shared/Maf.Durable/Maf.Durable.csproj | Shared implementation |
Commands from the root
dotnet run --project demos/Demo310_CheckpointResume/Demo310.App.csproj -c Release --no-build -- approveProcedures and variants
Run approve then reject. Read the In-memory engine state message and events around capture.
string? requestId = null;
await foreach (var evt in run.WatchStreamAsync(cancellationToken))
{
Console.WriteLine("Event: " + evt.GetType().Name);
if (evt is WorkflowErrorEvent error) throw new InvalidOperationException("Workflow failed.", error.Exception);
if (evt is RequestInfoEvent request)
{
var ticket = request.Request.Data.As<ApprovalTicket>();
if (ticket?.OperationId != operationId) throw new InvalidOperationException("Unexpected pending operation.");
requestId = request.Request.RequestId;
}
if (requestId is not null && evt is SuperStepCompletedEvent { CompletionInfo.Checkpoint: { } checkpoint })
return new(ApprovalWorkflow.Version, checkpoint.SessionId, checkpoint.CheckpointId, operationId, requestId);
}
throw new InvalidOperationException("No checkpoint containing the pending request was observed.");
What must be observable
CreateInMemory remains in the same process after graph reconstruction. The pending request is re-emitted; PrepareApprovalV1 must not run on resume. This program does not restore a checkpoint after process exit, contrary to the historical catalogue summary.
These results are expected from the linked code. Checks actually rerun for this lot are distinguished in exercises and reception; no unmeasured live output is presented as observed.
Limits and retained state
Demo300 responds in the live process; Demo310 retains its manager in memory; only Demo320 stores file checkpoints for another-process recovery. SQLite exists in all three variants. Local row uniqueness, no distributed exactly-once. The CLI trusts its operator without reviewer authentication.
dotnet test tests/Maf.Durable.Tests/Maf.Durable.Tests.csproj -m:1 -c Release --no-build --no-restore