Two Foundry recovery tests have synchronization gaps.
Assert.Equal() Failure: Collections differ
Expected: ["6", "5", "4"]
Actual: ["6", "5"]
Assert.Contains() Failure: Sub-string not found
String: null
Not found: "CRASH-RECOVERED:<token>:PROCESS-CHANGED"
HTTP 409 (ServiceError: session_updating)
Session '<id>' is currently updating. Please try again after some time.
Description
Two Foundry recovery tests have synchronization gaps.
StoppedHost_RecoversWorkflowWithCompleteOrderedOutputAsyncwaits until the live HTTP response contains6,5, and4, then immediately reads the durable response file. AgentServer exposes live output before processing the checkpoint control event, so the file can still contain only6and5when the host stops.BackgroundResponse_ProcessCrash_RecoversAndCompletesAsynccallsEnvironment.Exit(70)immediately after the workflow input stage. The exit can race the first durable workflow boundary. The recovered response can reachCompletedwith workflow action items only and noCRASH-RECOVEREDmessage. Polling during process replacement can also return HTTP 409session_updating, which asks the caller to retry.Expected behavior:
Steps to reproduce:
6,5, and4with persisted output6and5.Completedwith no message output, or fail polling with HTTP 409session_updating.Error Messages / Stack Traces
Package Versions
Repository tests for
Microsoft.Agents.AI.Foundry.Hosting..NET Version
.NET 10
Additional Context
Observed in these workflow jobs: