In a multi-agent system, Agent A generates a parseTimestamp() utility function in src/utils/time.ts, while Agent B independently generates a nearly identical formatTimestamp() function in src/helpers/dates.ts. Neither agent knew the other was generating similar code. This duplication leads to inconsistent behavior across the codebase. What mechanism should be added to the multi-agent system to detect and prevent this type of duplicated effort?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Parallel workers duplicating effort is a coordination problem, not a coding problem. The fix is a shared manifest — like a sign-up sheet where each agent declares 'I'm building X' before building X. Any agent that queries the manifest sees the declaration and can reuse or coordinate instead of reimplementing independently.
Full explanation below image
Full Explanation
Duplicated effort in multi-agent systems is a coordination failure caused by agents operating without visibility into what their peers are building. The solution is a shared work registry — a central artifact (GitHub Issue, tracking file, or in-memory registry) that each agent queries before beginning a new implementation, and updates when it starts one.
The workflow is: 1. Agent A queries the registry before implementing parseTimestamp() — sees nothing registered — writes 'Agent A: implementing timestamp parsing utility' to the registry — proceeds with implementation. 2. Agent B queries the registry before implementing formatTimestamp() — sees Agent A's registration — recognizes the overlap — either reuses Agent A's implementation or coordinates a unified design.
This prevents duplication at the start rather than cleaning it up after the fact.
A shared registry can also enable proactive utility discovery: agents search the registry for existing implementations that match their need, enabling reuse of already-built components.
Why the other options fail: - Option A (post-hoc code review agent) detects and cleans up duplication but doesn't prevent it. By the time a review agent runs, both implementations exist, may have diverged, and callers may already depend on both. Prevention is preferable to cleanup. - Option C (single agent) eliminates duplication but also eliminates the performance benefits of parallel execution. A coordination mechanism allows parallel work without duplication — the correct tradeoff. - Option D (identical system prompts) ensures agents make the same decisions in isolation but doesn't give them visibility into what the other is building. Two agents with identical prompts working on different files will still independently implement the same utility with no knowledge of the other.
A shared work registry is the coordination mechanism that enables parallel agents to operate without duplicating effort.