fix(memory): retry transient index swaps on Windows#76024
fix(memory): retry transient index swaps on Windows#76024steipete merged 1 commit intoopenclaw:mainfrom
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. #64187 provides concrete Windows memory search steps and Next step before merge Security Review detailsBest possible solution: Land one memory-core fix with bounded transient rename handling, deterministic regression coverage, and changelog coverage, then close #64187 and retire the overlapping implementation path that is not chosen. Do we have a high-confidence way to reproduce the issue? Yes. #64187 provides concrete Windows memory search steps and Is this the best way to solve the issue? Yes. The PR targets the owner helper and avoids broad SQLite or core behavior changes; the only remaining choice is whether the narrower retry-only approach is preferred over #71611's fallback behavior. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1634f91a35b5. |
3884522 to
88558aa
Compare
88558aa to
2b53246
Compare
|
Follow-up after rebasing onto latest
Local verification after the rebase: |
Summary
fs.rename; on Windows, transient file locks can temporarily reject those renames.EBUSY,EPERM,EACCES) during memory index swaps.busy_timeout, or other SQLite stores.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
runMemoryAtomicReindex()uses file-levelrenamecalls to swap the SQLite index, WAL, and SHM files. On Windows, these renames can fail transiently when files are briefly locked by another process, the runtime, antivirus, or indexing software.Regression Test Plan (if applicable)
extensions/memory-core/src/memory/manager.atomic-reindex.test.tsUser-visible / Behavior Changes
Memory reindex swaps are more resilient to transient Windows file locks. No config or CLI changes.
Diagram (if applicable)
Security Impact (required)
NoNoNoNoNoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
fs.renamecan return transient errors such asEBUSY,EPERM, orEACCES.Expected
-wal/-shmfiles are still ignored.Actual
EBUSY,EPERM, andEACCESonly.Evidence
Verification run locally:
Result: 1 test file passed, 6 tests passed.
Result: passed.
Human Verification (required)
What I personally verified:
git diff --checkpasses.Edge cases checked:
What I did not verify:
Review Conversations
N/A: no bot review conversations yet.
Compatibility / Migration
YesNoNoRisks and Mitigations
moveMemoryIndexFiles()is now exported from the module and could be mistaken for a public API.vi.mock("node:fs/promises")approach.