Files
codex/codex-rs
Dmitriy Kovalenko adfcac1a42 Serialize session index mutations across processes (#57358)
## Why

The process-local mutex cannot coordinate session name appends and removals from multiple Codex processes sharing the same home directory.

## What changed

- Guard index mutations with a persistent `session_index.jsonl.lock` file, retaining the lock until the blocking worker finishes even if its caller is cancelled.
- Return a timeout error after 30 seconds of lock contention without modifying the index.
- Rewrite removals through a unique temporary file while preserving index permissions, and skip removal when the index is absent.

## Testing

Update regression tests to check lock retention after cancellation, timeout without writing, successful writes after contention clears, and removal with a missing home directory. Retain coverage for cancelled queued updates preserving the next write.

GitOrigin-RevId: 5231c9ff85c6b34de5ee92931d119b6f46bd583b
2026-10-27 04:47:37 +00:00
..
…
…
…