Skip to content

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

Merged
peibekwe merged 3 commits into
microsoft:mainfrom
he-yufeng:fix/checkpoint-index-session-filter-5942
Jun 11, 2026
Merged

.NET: fix: filter filesystem checkpoint index by session#6132
peibekwe merged 3 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 Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows 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
@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

@he-yufeng he-yufeng force-pushed the fix/checkpoint-index-session-filter-5942 branch from fae6a63 to a864656 Compare June 6, 2026 19:07
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased onto current microsoft:main and force-pushed the cleaned head.

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

@he-yufeng

Copy link
Copy Markdown
Contributor Author

I checked this review point again. The current branch now filters RetrieveIndexAsync(sessionId, withParent) by both session id and parent checkpoint id:

  • FileSystemJsonCheckpointStore.CheckpointParents stores the persisted parent checkpoint id from the index
  • RetrieveIndexAsync filters by checkpoint.SessionId == sessionId and, when withParent is set, parentCheckpointId == withParent.CheckpointId
  • RetrieveIndexAsync_ShouldFilterByParentCheckpointAsync covers both the live store and reopened-store path

Re-ran focused validation:

  • git diff --check upstream/main..HEAD
  • 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)

@he-yufeng

he-yufeng commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the legacy-index compatibility concern in f273e0e. New index rows now explicitly record whether parent metadata is known, which distinguishes a known root checkpoint from a pre-upgrade row whose parent is unknown. Parent-filtered lookup keeps unknown legacy rows discoverable instead of silently dropping them, while new rows still filter exactly. Added a reopened-store legacy-index regression test. Validation: dotnet build succeeded with 0 warnings/errors; FileSystemJsonCheckpointStoreTests 9 passed; dotnet format --verify-no-changes passed (workspace-load warning only); git diff --check passed.

@he-yufeng he-yufeng force-pushed the fix/checkpoint-index-session-filter-5942 branch from f273e0e to 941d9e5 Compare June 11, 2026 21:15
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Updated in 941d9e526 to cover the remaining review case.

I added a reopened legacy-index regression test that calls RetrieveIndexAsync(sessionId, unrelatedCheckpoint) and verifies the legacy child entry remains discoverable when its parent metadata is unknown.

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; 6 SourceLink/git metadata 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
# 10 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 941d9e5 to bd4dde3 Compare June 11, 2026 21:19
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased onto current microsoft:main and pushed bd4dde32a.

The remaining review case is still covered by the new legacy-index test. Validation after the rebase:

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
# 10 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 upstream/main..HEAD
# passed

@peibekwe peibekwe added this pull request to the merge queue Jun 11, 2026
Merged via the queue into microsoft:main with commit 4c1b9ef Jun 11, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

4 participants