Parallel sessions overwrote each other's work because they shared a working directory #2
crowcreation
started this conversation in
Failure Patterns
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I was running 4-5 AI coding sessions in parallel across different tasks in the same repository. Each session checked the current branch at startup and confirmed it was correct. Everything looked fine.
Mid-session, one task created a new branch. Another session's pre-flight check had already passed, so it didn't notice. When session #3 committed, it committed to the wrong branch. Session #4's file edits were silently overwritten when session #2 merged.
Four incidents in a single afternoon. None of them crashed. None threw errors. Each session completed its work successfully in isolation. The failures were invisible until I checked what had actually landed.
Drift mode: State staleness + context fragmentation
What broke: Each session cached its branch state at startup and never rechecked. The assumption "branch hasn't changed since I checked" was true when checked and false by the time the commit happened. No session had visibility into what the other sessions were doing.
How it was detected: Post-merge inspection. One commit included content from a different feature branch. Working backwards from there, found the other three incidents.
What changed: Added a branch verification check that runs immediately before every commit, not just at session startup. The pre-flight check catches divergence at startup; the pre-commit check catches divergence that accumulates during long sessions. Simple rule, but it required failing four times in one day to see why startup-only verification wasn't enough.
Pattern: Pre-flight checks validate a point-in-time snapshot. For long-running sessions where external state can shift, you need validation at the point of action too, not just at the point of entry.
All reactions