#22432: feat(memory): harden writes with cross-process file locking
docs
channel: bluebubbles
gateway
extensions: memory-core
docker
agents
size: M
Cluster:
ContextMemory Enhancements
## Summary
- harden memory write critical sections with cross-process file locking
- apply to both `memory_write` and `memory_upsert`
- preserve concurrent upsert e2e safety coverage
## Stacking / review notes
- **This is intentionally stacked on #21003** (memory tools foundation).
- Until #21003 merges, this PR diff will include shared foundation changes.
- After #21003 lands, this should collapse to the incremental lock-hardening delta.
## Why
In-process mutexes are not sufficient when multiple workers/processes can touch memory files (for example cron + active user session). Cross-process locking prevents write interleaving and corruption risk.
Most Similar PRs
#21003: feat(memory): add durable memory_write + memory_upsert tools
by SmithLabsLLC · 2026-02-19
70.1%
#7480: feat: Add CoreMemories hierarchical memory system
by Itslouisbaby · 2026-02-02
55.7%
#10283: fix(agents): close TOCTOU race in session write lock acquisition
by programming-pupil · 2026-02-06
54.8%
#7894: Memory improvements: Give OpenClaw better memory + REM sleep
by bornio · 2026-02-03
54.8%
#11860: fix(memory): enable SQLite WAL mode for concurrent access safety
by Sojemand · 2026-02-08
54.2%
#5649: fix(security): harden file permissions and header merging
by sfo2001 · 2026-01-31
53.8%
#20791: Feature/aeon memory plugin
by mustafarslan · 2026-02-19
53.6%
#17887: refactor: consolidate atomic JSON writes into shared writeJsonAtomic
by iyoda · 2026-02-16
52.8%
#15639: fix(memory): serialize local embedding initialization to avoid dupl...
by SubtleSpark · 2026-02-13
52.0%
#9438: fix: auto-detect low-memory environments and prevent test OOM
by CompassHXM · 2026-02-05
51.9%