e-naxosMAF COURSE / COURS
Français

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

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
Required projects
ProjectRole
demos/Demo310_CheckpointResume/Demo310.App.csprojApp
shared/Maf.Durable/Maf.Durable.csprojShared implementation

Commands from the root

dotnet run --project demos/Demo310_CheckpointResume/Demo310.App.csproj -c Release --no-build -- approve

Procedures 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.");

shared/Maf.Durable/ApprovalDemo.cs · L78–L92 · 9a895c94534c

Source code · Maf.Durable · Folder

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

Contracts and prerequisites

Prerequisites

Continue reading

Complete demo folder · README

lot009-workflows-1 · 2026-10-24 · 9a895c94534cd5fc6f3da883e37e5f7856e588c1