Skip to content

.NET: fix: filter filesystem checkpoint index by session#6132

Open
he-yufeng wants to merge 2 commits into
microsoft:mainfrom
he-yufeng:fix/checkpoint-index-session-filter-5942
Open

.NET: fix: filter filesystem checkpoint index by session#6132
he-yufeng wants to merge 2 commits into
microsoft:mainfrom
he-yufeng:fix/checkpoint-index-session-filter-5942

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • filter FileSystemJsonCheckpointStore.RetrieveIndexAsync by the requested session id
  • add a regression test that covers mixed-session indexes before and after reopening the store

Fixes #5942.

To verify

  • dotnet build dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj --no-restore --tl:off
  • dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.exe --filter-method "*RetrieveIndexAsync_ShouldOnlyReturnCheckpointsForRequestedSessionAsync" --no-progress
  • dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.exe --filter-class "Microsoft.Agents.AI.Workflows.UnitTests.FileSystemJsonCheckpointStoreTests" --no-progress
  • git diff --check

Note: direct dotnet test is blocked locally by the Microsoft.Testing.Platform / .NET 10 VSTest entrypoint error, so I ran the generated test runner executable instead.

Copilot AI review requested due to automatic review settings May 28, 2026 09:29
@moonbox3 moonbox3 added .NET workflows Related to Workflows in agent-framework labels May 28, 2026
@github-actions github-actions Bot changed the title fix: filter filesystem checkpoint index by session .NET: fix: filter filesystem checkpoint index by session May 28, 2026
this.CheckDisposed();

return new(this.CheckpointIndex);
return new(this.CheckpointIndex.Where(checkpoint => checkpoint.SessionId == sessionId).ToArray());
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.

Please also include filtering by withParent

@he-yufeng
Copy link
Copy Markdown
Contributor Author

Updated in 04e1cba to include the parent filter as well.

The filesystem index now persists the parent checkpoint id, reloads it with the index, and applies withParent in RetrieveIndexAsync. I also added coverage for both the live store and a reopened store so the persisted index path is covered.

Validation:

  • dotnet build dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Microsoft.Agents.AI.Workflows.UnitTests.csproj --no-restore
  • dotnet dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/bin/Debug/net10.0/Microsoft.Agents.AI.Workflows.UnitTests.dll --filter-class Microsoft.Agents.AI.Workflows.UnitTests.FileSystemJsonCheckpointStoreTests --no-progress
  • git diff --check

Note: this machine has only .NET SDK 10.0.203, so direct dotnet test hits the Microsoft.Testing.Platform/VSTest entrypoint error. I ran the generated MTP test app directly after build.

@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased this branch onto current upstream/main again. The withParent filtering update remains in the branch, and the PR diff is back down to the checkpoint store plus its tests.

Validation on Windows:

dotnet build dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj --tl:off
# build succeeded, 0 warnings, 0 errors

dotnet .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.dll --filter-method "*RetrieveIndexAsync_ShouldOnlyReturnCheckpointsForRequestedSessionAsync" --no-progress
# 1 passed

dotnet .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.dll --filter-class "Microsoft.Agents.AI.Workflows.UnitTests.FileSystemJsonCheckpointStoreTests" --no-progress
# 8 passed

git diff --check upstream/main..HEAD

@he-yufeng he-yufeng force-pushed the fix/checkpoint-index-session-filter-5942 branch from 9bf2a5b to 576da57 Compare June 4, 2026 05:10
@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased onto the latest microsoft:main and reran the checkpoint-store checks.

Validation:

dotnet build .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj -f net10.0 -c Debug --tl:off
# succeeded, 0 warnings, 0 errors

dotnet .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.dll --filter-class Microsoft.Agents.AI.Workflows.UnitTests.FileSystemJsonCheckpointStoreTests --no-progress
# 8 passed

git diff --check

dotnet test itself still hits the repo's local .NET 10 Microsoft.Testing.Platform/VSTest incompatibility, so I used the same direct MTP runner path after building.

@he-yufeng he-yufeng force-pushed the fix/checkpoint-index-session-filter-5942 branch from 576da57 to c681aa3 Compare June 4, 2026 20:27
@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased onto the latest microsoft:main and pushed c681aa31.

The requested withParent coverage is still included: the filesystem checkpoint index persists and reloads the parent checkpoint id, and RetrieveIndexAsync applies the parent filter together with the session filter. The tests cover both the live store and a reopened store so the persisted index path is exercised.

Current local check against fetched upstream/main:

git rev-list --left-right --count HEAD...upstream/main
# 2 0

Validation on Windows:

dotnet build .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj -f net10.0 -c Debug --tl:off
# succeeded, 0 warnings, 0 errors

dotnet .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.dll --filter-class Microsoft.Agents.AI.Workflows.UnitTests.FileSystemJsonCheckpointStoreTests --no-progress
# 8 passed

dotnet format dotnet\agent-framework-dotnet.slnx --verify-no-changes --no-restore --include dotnet\src\Microsoft.Agents.AI.Workflows\Checkpointing\FileSystemJsonCheckpointStore.cs dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\FileSystemJsonCheckpointStoreTests.cs
# exit 0; workspace load warning only

git diff --check
# passed

@he-yufeng he-yufeng force-pushed the fix/checkpoint-index-session-filter-5942 branch from c681aa3 to fae6a63 Compare June 5, 2026 05:35
@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased onto current microsoft:main and pushed fae6a6377.

Validation on Windows:

dotnet build .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj -f net10.0 -c Debug --tl:off
# succeeded, 0 warnings, 0 errors

dotnet .\dotnet\tests\Microsoft.Agents.AI.Workflows.UnitTests\bin\Debug\net10.0\Microsoft.Agents.AI.Workflows.UnitTests.dll --filter-class Microsoft.Agents.AI.Workflows.UnitTests.FileSystemJsonCheckpointStoreTests --no-progress
# 8 passed

git diff --check upstream/main..HEAD
# passed

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

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

3 participants