An orchestrator assigns a refactoring task to two subagents simultaneously: Agent A is tasked with updating function signatures in api_client.py and Agent B is tasked with updating callers of those functions in the same file. Both agents complete their tasks and commit their changes. When the commits are merged, the file contains conflicting edits and broken function calls because both agents modified overlapping sections without knowledge of each other. What coordination mechanism was missing?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Sending two painters to the same wall with different color instructions at the same time guarantees a mess. When two agents share a file, the orchestrator must enforce that only one works on it at a time — either through file ownership rules or by sequencing tasks so the second agent starts only after the first is done and committed.
Full explanation below image
Full Explanation
File-level conflicts are a predictable failure mode when multiple agents operate on shared files without coordination. The orchestrator's responsibility is to detect these dependencies and handle them through one of two patterns:
1. File ownership: the orchestrator assigns each file to exactly one agent for the duration of the task. No other agent may modify that file while the owning agent has it. This is suitable when agents' work is truly independent.
2. Sequential dependency: when one agent's changes are prerequisites for another (as in this case — Agent B needs to know Agent A's new function signatures to update the callers correctly), the orchestrator must sequence the tasks. Agent B should not start until Agent A has completed and the new signatures are visible in the repository.
In this specific scenario, both patterns are relevant: sequential ordering is required because Agent B's changes depend on Agent A's output, not just file ownership.
Option A (real-time chat channel between agents) is not a standard coordination mechanism in agentic systems and introduces complexity without a reliable protocol for conflict resolution.
Option C (separate file copies + manual merge) is operationally expensive, defeats the purpose of automation, and reintroduces human bottlenecks that agents are meant to reduce.
Option D (separate branches + auto-merge) is a version control approach but does not solve the semantic conflict. Auto-merge handles syntactic conflicts only; if both agents modified the same lines with conflicting logic, auto-merge will fail or produce incorrect code even when it succeeds.