Skip to content

A2A Protocol

Talon’s Agent-to-Agent (A2A) protocol lets personas delegate tasks to each other over the internal durable queue. No external orchestration needed — delegation is just a tool call.

Talon uses the task model of Google’s A2A protocol for internal routing only. It runs in-process and is not wire-compatible. There is no network endpoint and no streaming.

  1. Persona A calls persona_send with a target persona name and a message
  2. Talon stores the task in the a2a_tasks table and enqueues a collaboration queue item for persona B
  3. Persona B picks it up, runs its agent, and optionally returns a result
  4. If await_reply: true, persona A’s tool call blocks until the reply arrives or the wait times out

The queue handles durability and crash recovery. Collaboration items bypass the inflight lock so they can be processed even while the source persona’s run is still active. A run that waits in persona_send or persona_task_status releases its queue.concurrencyLimit slot until it resumes, so Talon can always dispatch the delegated task.

:::tip Provider isolation Delegated A2A tasks always run on the target persona’s configured provider, regardless of which provider the source thread was using. This prevents provider affinity contamination and ensures each persona runs on its intended model. :::

Four host tools handle delegation: persona_send, persona_task_status, persona_task_cancel, and persona_list. One capability family grants all four: persona.send:* or a scoped persona.send:<persona-name>. Grant it to any persona that needs to delegate work:

personas:
- name: orchestrator
capabilities:
allow:
- persona.send:*

Without this capability, the tools are hidden from the agent’s tool list entirely.

persona.send:* lets a persona delegate to any persona. To limit it, list one persona.send:<persona-name> label per allowed target:

personas:
- name: coordinator
capabilities:
allow:
- persona.send:researcher
- persona.send:code-reviewer

coordinator can now delegate only to researcher and code-reviewer.

  • persona_send rejects any other target before anything is queued. The error names the allowed targets.
  • persona_list and the “Available personas” roster in the system prompt show only the allowed targets.
  • The daemon checks the calling persona’s own capabilities. A delegated persona is limited by its own labels, not by those of its caller.
  • persona_task_status and persona_task_cancel stay available with any persona.send label.
  • A wildcard wins over scoped labels. An unscoped persona.send behaves like persona.send:*.
  • Names are matched exactly and are case-sensitive. A scoped name that matches no configured persona is logged as a warning at load and never matches.

Use the persona_send host tool:

persona_send({
target_persona: "researcher",
message: "Find the latest pricing for AWS Lambda in eu-west-1",
await_reply: true
})
ParameterTypeRequiredDescription
target_personastringYesName of the target persona, exactly as returned by persona_list
messagestringYesComplete, self-contained brief. It is the only thing the target sees
await_replybooleanNotrue blocks until the target responds (default: false)
timeout_msnumberNoMax ms to wait when await_reply: true; default 300000 (5 minutes), max 1800000 (30 minutes)
cancel_on_timeoutbooleanNoWith await_reply: cancel the delegated task if the wait times out (default: false)

When await_reply: false (fire-and-forget), the tool returns immediately with the task ID. The target processes the task asynchronously.

When await_reply: true, the call waits up to 5 minutes (configurable with timeout_ms). If the target finishes before the timeout expires, the result is returned inline. If the timeout expires first, a structured timeout response is returned containing the task_id. The delegated task keeps running. Use persona_task_status to retrieve the final result later. With cancel_on_timeout: true, Talon cancels the task instead: a pending task is dropped and an in-flight run is aborted.

The wait includes the time the task spends queued behind other tasks for the same persona. It also counts toward the calling persona’s own queryTimeoutMinutes (default 10). For delegations that can take longer than 5 minutes, raise timeout_ms and the calling persona’s queryTimeoutMinutes together. Or send without await_reply and collect the result with persona_task_status.

Use persona_list to discover available delegation targets:

persona_list()

Returns an array of persona cards:

[
{
"name": "researcher",
"description": "Research assistant with web search capabilities",
"skills": ["web-search", "file-analysis"]
},
{
"name": "writer",
"description": "Content writer for blog posts and documentation",
"skills": ["markdown-editor"]
}
]

The calling persona is excluded from the list. With scoped persona.send:<persona-name> labels, the list shows only the allowed targets. skills is the persona’s configured skill list.

description comes from the description: key in the frontmatter of the target’s system.md. Without that key, Talon falls back to the first line of the prompt body. Write the description so a caller can tell when to delegate to this persona:

---
description: "Code reviewer: security and performance review of diffs and PRs; returns findings ranked by severity"
---

Talon also explains delegation to the calling agent. Every persona that is allowed persona_send gets the persona-delegation instructions in its system prompt, followed by an “Available personas” roster. The roster has one line per other loaded persona that the caller may delegate to, sorted by name. Descriptions are cut to 200 characters and the roster holds at most 30 entries. Talon rebuilds it on hot reload. A persona with no description shows a reminder to add one.

The instructions come from templates/tool-instructions/persona.send.md. See Tool instructions.

When await_reply: true times out before the target persona finishes, persona_send returns a structured response containing the task_id. Use persona_task_status to retrieve the result:

persona_task_status({
task_id: "abc123",
wait_ms: 60000 // optional: poll for up to 60 s
})
ParameterTypeRequiredDescription
task_idstringYesTask ID from the persona_send timeout response
wait_msnumberNoPoll until terminal state or this duration elapses

Terminal states are completed, failed, and canceled. Requires a persona.send capability.

Use persona_task_cancel to stop a delegation you no longer need:

persona_task_cancel({
task_id: "abc123",
reason: "superseded" // optional
})
ParameterTypeRequiredDescription
task_idstringYesTask ID returned by persona_send
reasonstringNoShort reason, recorded on the canceled task

A queued task is dropped. A running task is aborted. The tool returns { task_id, state, canceled }. canceled: false means the task had already finished, and state is its real final state. A persona can only cancel tasks that it submitted itself in its current thread.

From the command line:

Terminal window
npx talonctl a2a cancel 2b004602-b6ac-4dec-bd7b-f88e0565a16a --reason "superseded"

a2a cancel asks the running daemon, so an in-flight run is aborted. If the daemon does not answer within --timeout (default 5000 ms), the command cancels the task directly in the database. It needs the full task ID. a2a list shows only the first 8 characters, so take the full ID from the persona_send result or from a2a send.

A2A tasks have their own states in the a2a_tasks table:

StateMeaning
submittedTask accepted, waiting for a free slot on the target persona
workingAdmitted. The agent runner is processing it
input-requiredReserved. The current implementation never sets it
completedTarget persona finished and returned a result
failedFinal failure, with an error code
canceledCanceled by the caller, by cancel_on_timeout, by the CLI, or by the task TTL

Tasks are persisted in SQLite and survive daemon restarts.

Lifecycle rules:

  • Terminal states are final. completed, failed, and canceled are never overwritten. Talon skips a queue item whose task is already terminal.
  • Busy personas queue. At most maxConcurrentPerTarget tasks run per target persona. Further tasks stay submitted and are admitted in submission order. Talon rejects a submission only when the backlog for that persona reaches maxQueuedPerTarget, or when it would create a delegation cycle.
  • failed means final. With maxAttempts above 1, a task stays working across queue retries. Talon marks it failed only on the last attempt. Nothing retries a failed task automatically. The calling agent decides whether to resend.
  • Stale tasks are reaped. At startup and every 60 seconds, Talon marks tasks whose queue item is gone, completed, or dead-lettered as failed. It cancels tasks older than taskTtlMinutes.
  • Hot reload rebuilds the agent cards, so a persona added by talonctl reload is routable immediately. Changes to the a2a: limits need a restart.

Each A2A task carries a hop counter. When persona A delegates to persona B, the hop count increments. Talon enforces a maximum hop depth to prevent infinite delegation chains.

The default limit is 4 hops, configurable via a2a.maxHops in talond.yaml (bounds: 1–32). When the limit is reached, the task is rejected with a clear error message so the calling persona can handle the failure.

Talon also rejects delegation cycles. A submission fails when the target is already running an ancestor of the new task and would wait on itself.

The A2A limits live under the top-level a2a: key in talond.yaml. All keys are optional:

a2a:
maxHops: 4
maxConcurrentPerTarget: 1
maxQueuedPerTarget: 10
maxAttempts: 1
taskTtlMinutes: 60
FieldDefaultBoundsWhen to change
maxHops41–32Increase if you have deep orchestrator chains; decrease to tighten delegation depth.
maxConcurrentPerTarget11–100Tasks that may run at once per target persona. Raise it to allow parallel fan-out to the same persona.
maxQueuedPerTarget100–1000Tasks that may wait per target persona. Submissions beyond it are rejected with a “Max queued” error.
maxAttempts11–20Queue attempts before dead-letter. A higher value re-runs the whole delegated task, including its side effects.
taskTtlMinutes601–1440Non-terminal tasks older than this are canceled.
Terminal window
# List the 20 most recent A2A tasks
npx talonctl a2a list
npx talonctl a2a list --status working --target software-engineer
# Submit a task manually (for testing)
npx talonctl a2a send software-engineer "Review the latest PR"
# Cancel a task
npx talonctl a2a cancel <taskId>
personas:
- name: orchestrator
model: claude-sonnet-4-6
systemPromptFile: personas/orchestrator/system.md
capabilities:
allow:
- persona.send:researcher
- persona.send:writer
- channel.send:my-slack
- name: researcher
model: claude-sonnet-4-6
systemPromptFile: personas/researcher/system.md
skills:
- web-search
capabilities:
allow:
- net.http
- name: writer
model: claude-sonnet-4-6
systemPromptFile: personas/writer/system.md
capabilities:
allow:
- channel.send:my-slack

The orchestrator receives user requests, delegates research to researcher (with await_reply: true), then delegates writing to writer. Each persona has only the capabilities it needs.