Skip to content

fix(memory): coordinate concurrent sandbox sync - #138

Merged
yanpgwang merged 1 commit into
mainfrom
codex/fix-memory-sync-concurrency
Aug 11, 2026
Merged

fix(memory): coordinate concurrent sandbox sync#138
yanpgwang merged 1 commit into
mainfrom
codex/fix-memory-sync-concurrency

Conversation

@yanpgwang

Copy link
Copy Markdown
Owner

Summary

  • coordinate Session-shared tool operations with Docker resource refreshes using provider-owned shared/exclusive file locks
  • let parallel Threads join the current filesystem wave while making Memory snapshot, optimistic PostgreSQL sync, and baseline refresh atomic with respect to active tools
  • avoid taking the synchronization barrier for Sessions without Memory attachments and document per-Thread concurrency accurately

Why

Managed Agents allows Threads in one Session to run concurrently while sharing a sandbox. Previously, Memory reconciliation protected each individual snapshot/replace call, but not the complete snapshot -> PostgreSQL sync -> refresh transaction. One Thread could therefore refresh /mnt/memory from an old snapshot while another tool was still modifying the shared mount.

The PostgreSQL Memory repository already rejects stale per-file SHA baselines. This change closes the filesystem-side race without serializing independent tool execution.

Verification

  • make verify
  • make test-service
  • make docs-check
  • real Docker + PostgreSQL regression covering an active tool wave, skipped pre-tool refresh, blocking post-tool writeback, and persisted Memory contents

References

@yanpgwang
yanpgwang merged commit 8955d7c into main Aug 11, 2026
6 checks passed
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.

1 participant