In a multi-agent workflow, Agent A and Agent B are both assigned tasks that involve modifying the shared configuration file config/settings.json. What mechanism should detect this overlap before the agents begin execution?
Select an answer to reveal the explanation.
Short Explanation
Good project managers check for resource conflicts before assigning tasks — they don't wait for two workers to show up at the same job site. You should compare file target lists across all agents and surface conflicts before anyone starts swinging hammers.
Full Explanation
Detecting overlapping file modifications before execution is a proactive strategy that prevents the more expensive problem of resolving conflicts after the fact.
Why analyzing the intended file modification lists of both agents before execution begins is correct: A pre-execution analysis step compares the list of files each agent intends to modify, derived from their task specifications and planning outputs. If two agents list the same file, the orchestrator flags this as a conflict before either agent begins. Resolution options include: serializing the agents, such as running one agent and then rebasing the other, splitting the task to eliminate overlap, or requiring a human to decide which agent handles the shared file.
Why waiting for both agents to complete and then running git merge to detect conflicts is wrong: This is a reactive approach that wastes the execution time of at least one agent. Merge conflicts also require human intervention to resolve, and the agents' changes may be deeply intertwined by the time the conflict is discovered.
Why allowing both agents to proceed with last-write-wins is wrong: Last-write-wins means one agent's changes are silently overwritten. The team may not notice that one agent's changes were lost, especially if both agents produced locally valid outputs. This is a silent data loss anti-pattern.
Why disabling concurrent agent execution is wrong: Disabling concurrent execution eliminates the performance benefits of multi-agent workflows. The correct solution is to detect and manage overlaps, not to prohibit concurrency.