Python: handle concurrent FileSystemAgentFileStore deletion - #8457
Open
WhaleTech (ryo-whaletech) wants to merge 2 commits into
Open
WhaleTech (ryo-whaletech) wants to merge 2 commits into
WhaleTech (ryo-whaletech) wants to merge 2 commits into
Conversation
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 17, 2026 10:38 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 17, 2026 10:38 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 17, 2026 10:38 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 17, 2026 10:38 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
WhaleTech (ryo-whaletech)
September 17, 2026 10:38
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation preserves existing behavior while correctly covering the reported race with a focused regression test.
Pull request overview
Adds process-local synchronization to preserve FileSystemAgentFileStore.delete() result semantics during concurrent same-path deletion.
Changes:
- Adds bounded striped locks around file checks and deletion.
- Maps deletion-time
FileNotFoundErrortoFalse. - Adds a deterministic cross-instance concurrency regression test.
File summaries
| File | Description |
|---|---|
python/packages/core/agent_framework/_harness/_file_access.py |
Serializes same-stripe deletions and handles deletion races. |
python/packages/core/tests/core/test_harness_file_access.py |
Tests concurrent deletion across store instances. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
WhaleTech (ryo-whaletech)
marked this pull request as ready for review
September 17, 2026 10:41
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 17, 2026 10:41 — with
GitHub Actions
Active
westey (westey-m)
approved these changes
Sep 17, 2026
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 18, 2026 12:14 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
force-pushed
the
fix/filesystem-agent-file-store-concurrent-delete
branch
from
September 18, 2026 12:14
4754c48 to
8a6eb8e
Compare
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
September 18, 2026 12:14 — with
GitHub Actions
Active
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
AgentFileStore.delete()returnsTruewhen deletion occurs andFalsewhen the file does not exist. SeparateFileSystemAgentFileStoreinstances that share a root can race on the same filesystem entry and violate that result contract.Description & Review Guide
FileNotFoundErrorduring deletion toFalse, and add deterministic cross-instance regressions for same-path and case-alias deletion.Related Issue
Fixes #8456
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.