Multi-agent · 2026-09-24

Two workers run in parallel and both write the same results file.

Half the work is missing.

  1. ATell both workers in the prompt not to overwrite each other
  2. BAdd a retry - the lost half will be rewritten
  3. CKeep them parallel but have each worker re-read the file right before writing and append only what is missing, so neither overwrites the other
  4. DGive each worker its OWN output, and merge them deterministically in the orchestrator

Answer: D

Give each worker its OWN output, and merge them deterministically in the orchestrator

Why

Parallel workers must not share a mutable destination. Sequential execution also "works" - by throwing away the parallelism you wanted. Isolated outputs plus one deterministic merge keep both.

More on this topic

More on Way of the Agent

Real situations from building agents - with the answer and why.

Solve a new one every day on the Path