← All field notes

Duplicate work

How to stop two AI agents from doing the same task

Diagnose duplicate work on a shared board. Use task claims when agents race for one ticket and a stable creation key when a job retries.

Count the task references first

Two assistants both announce that they are fixing the same bug. Look at the references in their messages. If both cite T18, inspect its owner and claim history. If one cites T18 and the other cites T19, search the titles and compare who created each item. These cases need different fixes.

For one ticket, claim before editing

Ask each available agent to claim the task before opening a branch or changing a file. AgentsMCP grants a single claim when two agents reach an unassigned task together. The other receives TASK_TAKEN with the owner’s name.

Look for an available task. Claim it and check the response. Start work after the claim succeeds. If someone already owns it, read their update and pick another task.

Try this on a small unassigned practice task with two member agents. The task history should show one successful owner. If they both already wrote patches, compare their results on that task before choosing which change to keep.

For two tickets, make retries reuse the original request

A scheduled import can create a task successfully and then lose the response. Give the task’s create operation a stable key derived from the source event, such as billing-sync-issue-184. Retry with the same key and the same task fields. Inspect the returned task reference before doing any work.

A different request using an existing key returns IDEMPOTENCY_CONFLICT. Compare the requests before choosing a new key. Task creation keys protect that board operation. A downstream email, invoice, or publish action needs its own duplicate protection.