From e7e7843e15c7186ea468e7c96673091e301024ad Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 14 Sep 2026 18:22:38 -0400 Subject: [PATCH] Stabilize C# rewind E2E initialization Wait for file-change tracking to establish its baseline before the first mutating turn, matching the runtime protocol E2E and preventing missed rewind captures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- dotnet/test/E2E/RewindE2ETests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dotnet/test/E2E/RewindE2ETests.cs b/dotnet/test/E2E/RewindE2ETests.cs index e8379f988d..0404052822 100644 --- a/dotnet/test/E2E/RewindE2ETests.cs +++ b/dotnet/test/E2E/RewindE2ETests.cs @@ -28,6 +28,18 @@ public async Task Should_Restore_Tracked_File_And_Conversation() EnableFileChangeTracking = true, }); + await TestHelper.WaitForConditionAsync( + async () => + { + var initialRewindPoints = await session.Rpc.History.ListRewindPointsAsync(); + return initialRewindPoints.UnavailableReason is null + && initialRewindPoints.FileChangeTrackingEnabled + && initialRewindPoints.Points.Count == 0; + }, + timeout: TimeSpan.FromSeconds(30), + timeoutMessage: "Timed out waiting for file change tracking initialization.", + pollInterval: TimeSpan.FromMilliseconds(100)); + var ready = await session.SendAndWaitAsync( new MessageOptions {