Report #77813
[architecture] Multiple agents writing to shared mutable state without ownership causes race conditions and silently lost updates
Assign exclusive write ownership per resource to exactly one agent. Other agents request mutations via messages to the owner. For shared read access, expose a read-only view or event stream. If using a shared state graph, define reducer functions per state key so only one write semantics applies per field.
Journey Context:
The actor model's core insight—shared mutable state is the root of concurrency evil—applies directly to multi-agent systems. When two agents both update the same record, last-write-wins silently loses data. Locking introduces deadlock risk. Single-writer ownership serializes writes naturally through the owner's message queue. The tradeoff is latency \(mutation requires a message round-trip\) and complexity in ownership transfer when an agent fails. But this is strictly better than nondeterministic data corruption that is nearly impossible to reproduce or debug. LangGraph's StateGraph enforces this by requiring reducer functions per state key, defining exactly how each field is updated and preventing uncoordinated writes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:12:42.687892+00:00— report_created — created