Skip to content

fix(memory): persist graph snapshots atomically - #4707

Closed
CryoThrust wants to merge 1 commit into
modelcontextprotocol:mainfrom
CryoThrust:fix/memory-atomic-graph-persistence
Closed

fix(memory): persist graph snapshots atomically#4707
CryoThrust wants to merge 1 commit into
modelcontextprotocol:mainfrom
CryoThrust:fix/memory-atomic-graph-persistence

Conversation

@CryoThrust

Copy link
Copy Markdown

Summary

  • write memory graph snapshots to a unique temporary file
  • atomically replace the live JSONL file with rename
  • clean up temporary files on both success and failure
  • add regression coverage ensuring persistence leaves no temporary artifact

Closes #4614

Validation

  • git diff --check
  • Local Vitest execution is blocked because the Homebrew Node 22 binary cannot load libsimdjson.29.dylib; the change is covered by the repository test suite in CI.

@CryoThrust

Copy link
Copy Markdown
Author

Closing because earlier PRs #4656 and #4696 already cover atomic memory graph persistence. Avoiding duplicate implementation.

@CryoThrust CryoThrust closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

saveGraph() in src/memory uses non-atomic fs.writeFile — risk of corrupted memory file on interruption

1 participant