A broker calls the insurer's support line on a Thursday afternoon. Two days ago he sent quote request SUB-1004. He has heard nothing. Where is it?
The support desk asks the intake team. The intake team looks at its records: the evidence request went to the assessment agent and was completed in under a second. After that, the intake agent's log says nothing. In the peer topology the intake agent passed the work on; the recommendation went from the underwriting agent back to the assessment agent and into the underwriter cockpit. The intake agent was never told the outcome, because in that design it was not supposed to own it.
Nobody did anything wrong in code. The design never said who owns the outcome after the first hop. This page separates three ways agents share work, by the one question that decides everything else: after the work moves, who is responsible for it?
Three patterns in plain words#
Delegation means the caller asks another agent to do part of the work and keeps ownership of the outcome. For example, the coordinator asks the assessment agent for evidence, waits for the artifact, and then decides what happens next. If the evidence is late, the coordinator's deadline fires; if it fails, the coordinator decides whether the case goes on.
A handoff means ownership of the work or the conversation moves to another agent, and the first one steps out. For example, a front-desk agent hands a conversation to a specialist agent, and from then on the specialist talks to the broker. The first agent no longer waits for anything.
Shared state means agents coordinate by reading and writing a common store instead of sending each other requests. For example, the underwriting agent stores a recommendation row; the underwriter cockpit reads it. Neither one sends the other a message. A blackboard is the classic form: a shared store that several agents watch, each adding what it can when the board shows something it can act on.
Plain English. Delegation is asking a colleague to check a figure for your report: it is still your report. A handoff is transferring a customer's call to another department: they now own the call. A shared board is the whiteboard in the office where anyone can pick up a task and write the result.
Ownership is the word under all three: the agent or person responsible for the outcome of a piece of work, who must notice if it stalls, decide what to do when it fails, and answer for it. Context transfer is what the receiving agent needs to carry on: the facts, the history, the constraints, the credentials. A handoff must transfer more context than a delegation, because the receiver now acts without the first agent behind it.
Diagram: Delegation, handoff, shared state · who owns the outcome
Each lane is one pattern, read left to right. In delegation the caller keeps an open request and gets the result back. In a handoff the first agent completes its part and steps out; the receiver owns what follows. With shared state, agents write to and read from a common store and never message each other.
- Delegation
- Coordinator asks: The caller sends a request and keeps a record of it with a deadline.
- Callee works: The callee does part of the work and answers the caller.
- Coordinator decides: The result comes back to the owner, which decides the next step and answers upstream.
- Handoff
- Intake asks: The first agent's request ends when the evidence is ready.
- Assessment passes it on: The assessment agent opens a new exchange with the underwriting agent. The intake agent is no longer involved.
- Outcome elsewhere: The recommendation goes back to the assessment agent and into the cockpit; upstream, only the run id and the trace connect it.
- Shared state
- Write a row: The underwriting agent stores the recommendation with an idempotency key.
- Read the board: The cockpit reads the row; the underwriter's decision is written to the same store. Nobody sends anybody a message.
The smallest primitive: who holds the open request#
The difference between delegation and handoff is visible in one data structure. In a delegation, the caller holds an open record of the request, with a deadline, until the result arrives. In a handoff, nobody upstream holds anything: the request was completed when the work was passed on.
In the example that record is a Call (tasks.py). Agent.call creates it, keeps it in self.calls, and starts the deadline. The orchestrator topology delegates: the coordinator keeps a Call for the evidence and another for the recommendation, and only completes its own workflow task when both are back. The peer topology hands off: the assessment agent completes its task for the intake agent as soon as the evidence is ready, and starts a new request of its own to the underwriting agent. From that moment the intake agent holds nothing open. The recommendation is not its business any more.
The insurance example: same case, two ownership models#
Compare the final lines of UW-403 in the two topologies (both runs pass all their checks; the agents here are scripted stand-ins, so these results show how the mechanism works, not how good any model is).
| Orchestrator: delegation | Peer: handoff | |
|---|---|---|
| The intake agent's open requests at the end | its workflow request, completed with the recommendation at 766 ms | its evidence request, completed with the artifact at 640 ms |
| Who receives the recommendation | the coordinator, then the intake agent | the assessment agent |
| Who would notice a silent underwriting agent | the coordinator (deadline 10,000 ms on the recommendation request) | the assessment agent (same deadline), not the intake agent |
| Who can answer the broker's "where is it?" | the intake agent, from its own records | nobody upstream; only the stored row or the trace |
The support desk's question has an easy answer in the first column and a hard one in the second. That is not a reason to forbid handoffs. It is the cost of one, and it must be paid somewhere: the stored row in the cockpit, the trace, or a notification back to the agent that talks to the broker.
The third pattern is in the example too. The recommendation row is shared state: record_recommendation writes it into World.rows, and the stand-in cockpit (tools_sim.py:Cockpit) reads it. The underwriter's decision goes into the same store. No agent sends the underwriter a message, and none waits for the decision; the board holds it.
An executable demonstration#
The peer run shows the handoff in the message log. The assessment agent completes its exchange with the intake agent (msg-0003, completed) and opens a new one with the underwriting agent (msg-0004, a new correlation id). The recommendation travels back on the second exchange only.
/opt/homebrew/bin/python3 run_case.py --case UW-403 --topology peer --dry-run
UW-403 · topology peer · run run-7f3a · agents: scripted stand-ins (no model called)
time ms from to type state ids
50 intake-agent → assessment-agent task.request - msg-0001 corr msg-0001 task - try 1
70 assessment-agent → intake-agent task.status working msg-0002 corr msg-0001 task task-a1 try 1
640 assessment-agent → intake-agent task.artifact completed msg-0003 corr msg-0001 task task-a1 try 1
640 assessment-agent → underwriting-agent task.request - msg-0004 corr msg-0004 task - try 1
660 underwriting-agent → assessment-agent task.status working msg-0005 corr msg-0004 task task-u1 try 1
706 underwriting-agent → assessment-agent task.artifact completed msg-0006 corr msg-0004 task task-u1 try 1
messages: 6 sent · 6 delivered · 0 duplicates dropped · 0 stale updates ignored · 0 deadlines fired
tasks (caller's view): evidence completed · recommendation completed
recommendation: escalate · citations R-ROOF-03 · missing - · evidence complete · routed to the senior underwriter · stated_confidence 0.8
tool calls: get_roof_assessment 1 · search_guidance 1 · find_similar_decisions 1 · check_eligibility 1 · record_recommendation 1
rows stored: 1 · human_decision: none (no person has decided yet)
trace: 1 trace_id · 22 spans · last message at 726 ms · run ends at 726 ms (simulated)
expected vs actual: PASS (10 of 10 checks)
All six messages carry the same run_id, run-7f3a, and one trace joins them. That is how the support desk can still answer the broker after a handoff: not by asking the intake agent, but by looking up the run.
Which failures each pattern invites#
Each pattern fails in its own way, and the failures are predictable.
Delegation fails by stalling the owner. The caller holds an open request and a deadline. If the deadline is missing or too long, the owner waits forever (the silent middle on Topologies). If the callee asks back, the owner must be able to answer. Delegation chains also stack: each owner's deadline must cover its callees' attempts.
A handoff fails by losing the outcome. Once the work has moved, nobody upstream notices if the receiver drops it. The receiver also works only with the context it was given: if the handoff carried the submission but not the broker's note that "the roof was replaced after storm damage", that fact is gone for good. And a handoff can loop: agent A hands to B, which decides it is A's job and hands it back.
Shared state fails by races and stale reads. Two agents read the same row, both act, and the second overwrites the first. An agent reads a row before the writer has finished. A board grows forever because nobody owns cleaning it. And because nobody sends a message, nobody is told: an agent must poll or subscribe to the store to notice a change.
Production pitfall. A handoff to a person is still a handoff. When the underwriting agent escalates UW-403 to a senior underwriter, the agent's work is done and the case is now a person's. If the senior underwriter's queue is not watched, the case waits, and no agent deadline will fire. Put a deadline on the queue, not only on the agents.
Before AI. Call centers and ticketing systems have lived with this for decades: a warm transfer (the first agent stays on the line until the second has the context) versus a cold transfer (the first agent hangs up). In backend systems, delegation is a synchronous or task-based call with a timeout; a handoff is publishing an event and forgetting it; shared state is a database table several services poll, with all the locking questions that brings.
How protocols and libraries express these patterns#
The A2A protocol, an open standard for messages between agents, describes delegation in its own terms: a client sends a message to a remote agent and follows the task it creates. Whether the client then steps out is a choice of the client's design, not of the protocol. Several agent libraries offer an explicit "handoff" or "transfer" primitive that moves the conversation to another agent; others model work as a graph over shared state. What each library calls these, and what it carries for you, is on Frameworks, read from each library's own documentation.
What this is not. Choosing which agent should take the work next, and under which condition, is control flow, owned by orchestrate.sammuthu.com. Durable shared state as storage (consistency, checkpoints, retention) belongs to memory.sammuthu.com. What context a model can see after a handoff, and how to fit it in its window, belongs to context.sammuthu.com.
Checklist: before work changes hands#
- For every place work moves: is it a delegation, a handoff or a write to shared state? Say which in the design.
- After the move, who owns the outcome, and how does that owner learn that it stalled?
- For a handoff: does the receiver get every fact it needs, including notes that are not in the schema?
- Can a handoff loop back? What stops it?
- For shared state: who may write each record, how are concurrent writes resolved, and who cleans up?
- Can the agent that talks to the customer still answer "where is it?" after the work has moved? From which record?
- Does a handoff to a person have a deadline on the person's queue?
The same idea for a coding agent. A planning agent delegates "run the tests" and waits; it owns the pull request. If instead it hands the pull request off to a review agent and steps out, the review agent now owns merging it, and must also own what happens when CI goes red after the review. Many teams use shared state without naming it: the pull request itself is the board, and the planning agent, the review agent and CI each read and write comments and statuses on it. Shipping the change is the subject of diff-to-deploy.sammuthu.com.
Make ownership a fieldAn owner column beats a convention
The cheapest fix for the support-desk story is to record ownership as data. Each run has an owner at every moment: the agent or role responsible for it now. A handoff writes a new owner; a delegation does not change it. The support desk then asks the run, not the agents. A run without an owner, or with an owner that has not touched it for longer than its deadline, is an alert.
This also settles escalation. When the underwriting agent escalates, it writes "senior underwriter" as the owner. That makes the handoff to a person explicit and measurable: how long do runs wait with a person as owner? The example records route_to on the recommendation, which is a step in that direction.
How much context should travelToo little loses facts; too much leaks them
A handoff that sends the whole history is safe for facts and unsafe for data: every receiver now holds everything, including fields it has no business seeing. A handoff that sends only the schema's fields is safe for data and loses whatever the schema did not anticipate. The middle way is a summary written for the receiver plus references (ids) to the full record, which the receiver can fetch if its scopes allow.
The example takes this route for evidence: the artifact carries ids (EV-ROOF-0412), not raw provider records, and each piece says where it came from. A receiver can cite without holding more than it needs. What a model should see from that context is a context-engineering question.
Blackboards at scaleCoordination without messages still needs rules
A blackboard decouples agents in time: the writer need not know who will read. That is attractive when many agents may contribute and their order is not known in advance. It moves every coordination problem into the store: who claims an item (a lease with an expiry), what happens to a claimed item whose agent died (the lease expires), how conflicting contributions are merged (last write wins, or versioned writes with compare-and-set), and how an agent learns that something changed (polling, or a change feed, which is a message stream again).
In practice most blackboards grow a small protocol of their own: claim, heartbeat, complete, release. At that point they are a task protocol implemented in a database, and the questions of Task lifecycle and Reliability return.
In one breath#
Work can move between agents three ways. Delegation keeps the outcome with the caller, which holds an open request and a deadline. A handoff moves the outcome to the receiver, and the first agent steps out, so someone else must notice if it stalls. Shared state lets agents coordinate through a common store, and brings races and stale reads. The deciding question is always the same: after the work moves, who owns the outcome?
Next: a delegated task is running somewhere else, and its owner wants to know what it is doing. Updates compares five ways to learn: polling, streaming, push notifications, callbacks and durable queues.