claude-memory/graph/decisions/wave-based-agent-delegation-avoids-file-contention-23bb23.md

1.1 KiB

id type title tags importance confidence created updated
23bb2301-21ee-4a02-8e4b-64e4eca3973b decision Wave-based agent delegation avoids file contention
cognitive-memory
agent-delegation
pattern
architecture
0.8 0.8 2026-02-13T18:03:08.417460+00:00 2026-02-13T18:03:08.417460+00:00

When delegating multiple tasks to agents that all modify the same file, run them in waves instead of all at once. Wave 1 (3 agents): additive changes that touch different sections - worked cleanly. Wave 2 (2 agents): one finished first and the second hit file contention errors until the first was done. Solution: tell the blocked agent to wait and retry after the other finishes.

Key pattern: group agents by whether their changes overlap. Additive-only changes (new methods, new constants, new CLI subcommands) can run in parallel. Changes that modify existing methods should be sequential.

Also confirmed from Phase 1: always check that get() returns new fields added by agents. They consistently add fields to store/write but forget to update get() return dict.