How it works
The inline wait, background polling, the wake-up prompt, and what happens when a worker goes quiet.
Claude waits about 7.5 seconds for an answer. If the worker isn't done, Claude gets a task id and moves on, the mod checks the worker every 5 seconds, and Claude gets a message when the task ends.
The inline window
When Claude calls send, the mod forwards the message to the worker and asks for a task back right away. It then polls the worker with GetTask after 0.5, 1, 2 and 4 seconds. That is the inline window, about 7.5 seconds in all.
If the task finishes inside the window, the result goes straight back to Claude as the tool result.
The mod also stops polling early when too little of the tool call's time budget is left. Every request to the worker is cut off at the budget as well, so a silent worker cannot hold up Claude's turn.
Background polling
A task that is still live after the window goes into session state. Claude gets its task id and a note: the worker is working on it, a message will come when it finishes, do not poll. Claude carries on with other work.
A timer polls every tracked task every 5 seconds. A poll that gets no answer within 15 seconds counts as failed. Tracked tasks live in session state, so the timer picks them up again when the session starts.
The status line
While a task is live, the status line shows it. The text depends on what is going on:
| State | Status line |
|---|---|
| One task running | a2a-mod: ⠋ fake slow 20 build 0:12: the worker, the task text cut to 32 characters, and the time since it started. |
| Several running | a2a-mod: ⠋ 2 running · 1 waiting |
| A task waiting for your input | a2a-mod: ? fake waiting: Which colour? |
| Several waiting, none running | a2a-mod: ? 2 waiting |
| A task just ended, nothing else live | a2a-mod: ✓ fake done 0:20 for 5 seconds. A failed task shows ✕ failed, a canceled one ⊘ canceled. |
The line updates once a second while anything runs. With animations off, the spinner is a still ●.
Waking Claude
A task is live while the worker reports submitted or working. Any other state ends tracking: completed, failed, canceled, rejected, input-required, auth-required, or a state the mod does not recognise.
When one or more tasks end, the mod submits one prompt to Claude. In the transcript it is one short line: a2a: fake task 3f9a… completed, or a2a: 2 tasks finished (fake ✓, adk ?) when several end together. The result is not in the line. The mod attaches it as context that Claude reads and you do not see, marked as a notice from the mod and not your words. If that context does not arrive, the send result has already told Claude to fetch the result with task.
A task that ends in input-required wakes Claude too. The context says how to answer: call send with the same taskId.
Lost contact
A task is dropped when 6 polls of it fail in a row, and Claude is told:
<alias> task <id>: lost contact with the worker after 6 failed checks. Use the task tool to try again.A 401 or 403 clears the cached token, so the next poll fetches a fresh one.
If you remove a worker while it has a task running, Claude is told the task is no longer tracked.
Related
- Commands and tools for the inputs of all five tools.
- Troubleshooting for the messages Claude can get back.