store: Wave-based agent delegation avoids file contention

This commit is contained in:
Cal Corum 2026-02-13 12:03:08 -06:00
parent c1f8ab3f91
commit 2354d790e3

View File

@ -0,0 +1,16 @@
---
id: 23bb2301-21ee-4a02-8e4b-64e4eca3973b
type: decision
title: "Wave-based agent delegation avoids file contention"
tags: [cognitive-memory, agent-delegation, pattern, architecture]
importance: 0.8
confidence: 0.8
created: "2026-02-13T18:03:08.417460+00:00"
updated: "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.