When you move an agent from a local function call to a remote HTTP endpoint, you lose three things: shared memory, a unified token ledger, and a single failure surface. Strands A2A, an open protocol for agent-to-agent communication, exposes these gaps with production telemetry from nine real runs.
The evidence is specific. A caller reports zero tokens for a run that consumed 2369 on the remote side. A remote tool raises an exception, yet the orchestrator marks the task completed. A reply times out, but the receipt already exists on disk. These are not edge cases. They are the default behavior when orchestration crosses process boundaries without new accounting primitives.
The Setup: Two Processes, One Port, No Shared Ledger
The test task is minimal. A fixture holds three invented per-node token counts. An agent must call sum_tokens to add them, then call save_draft to write a brief. Earlier experiments ran this inside one process using swarms, graphs, and workflow tools. This version splits the writer into a second OS process and calls it over HTTP.
Strands Agents SDK wraps the writer as an A2AServer and the caller as an A2AAgent. Both processes share one port and one file on disk. They share nothing else. No memory, no token counter, no exception stack.
The protocol is A2A (Agent-to-Agent), which defines discovery, invocation, and result serialization. The SDK marks its A2A integration as experimental in a log line. That warning is accurate.
Token Accounting Across Process Boundaries
Inside one process, you inspect an agent's token counters directly. Across a process boundary, you get a string and a status code.
Nine runs show the caller's AgentResult reporting zero tokens for work that consumed 2369 tokens on the remote side. The remote agent increments its own counter. The caller never sees it. The HTTP response does not include token metadata. The A2A protocol does not define a token ledger field.
You can add a custom header or embed token counts in the response body, but neither is standard. Without a shared ledger, each process maintains its own view. The caller sees zero. The remote agent sees 2369. Both are correct within their own scope.
This is not a bug. It is a missing primitive. Cross-process orchestration needs a token accounting layer that survives HTTP serialization.
Failure Propagation: When Completed Means Crashed
A remote tool raises an exception. The orchestrator marks the task completed anyway.
The failure happens inside the remote process. The exception propagates to the A2A server, which logs it and returns a 200 status code with a generic error message. The caller receives the response, parses the status, and marks the task completed.
The orchestrator has no visibility into the remote stack trace. It sees a successful HTTP transaction. The task state is completed, not failed. The error message is a string in the response body, not a structured failure signal.
To propagate failures correctly, you need:
- A status field in the A2A response that distinguishes success, partial success, and failure.
- A structured error object with exception type, message, and trace.
- A retry policy that interprets remote failures as retriable or terminal.
Without these, a remote crash looks like a successful no-op.
Receipt Timing: When the Reply Times Out but the Write Succeeded
A reply times out. The receipt already exists on disk.
The remote agent calls save_draft, which writes a file. The write succeeds. The agent prepares a response. Before the response reaches the caller, the HTTP timeout fires. The caller logs a timeout error. The file remains on disk.
The caller has no proof that the write succeeded. The timeout could mean:
- The remote agent crashed before writing.
- The remote agent wrote, then crashed before replying.
- The remote agent wrote and replied, but the network dropped the response.
- The remote agent is still running, and the reply will arrive late.
The only way to know is to check the file. But the caller does not know the file path unless the remote agent advertised it in the task definition. Even then, the caller must poll the filesystem or wait for an out-of-band signal.
This is a coordination problem. The receipt (the file) and the reply (the HTTP response) are decoupled. The receipt is durable. The reply is ephemeral. The caller needs a way to correlate them.
Architecture: How Strands A2A Wires Two Processes
The SDK provides two classes: A2AServer and A2AAgent.
A2AServer wraps an agent and exposes it over HTTP. It handles discovery, invocation, and result serialization. The server runs in a separate process, typically started with uvicorn or another ASGI server.
A2AAgent wraps an HTTP client and presents a remote agent as a local tool. The caller treats it like any other agent, but under the hood, every method call becomes an HTTP request.
The protocol defines three endpoints:
-
GET /discovery: Returns agent metadata, including available tools and input schema. -
POST /invoke: Accepts a task definition and returns a result. -
GET /status/{task_id}: Returns the current state of a running task.
The SDK uses FastAPI for the server and httpx for the client. The protocol is JSON over HTTP. No gRPC, no message queue, no shared memory.
Here is the server setup:
from strands_agents import Agent, A2AServer
from fastapi import FastAPI
writer_agent = Agent(
name="writer",
tools=[sum_tokens, save_draft],
model="amazon.nova-pro-v1:0"
)
app = FastAPI()
a2a_server = A2AServer(agent=writer_agent)
a2a_server.mount(app, path="/writer")
The caller setup:
from strands_agents import A2AAgent
remote_writer = A2AAgent(
base_url="http://localhost:8000/writer",
timeout=30.0
)
result = remote_writer.run(task="Add tokens and save brief")
The caller sees result.status, result.output, and result.tokens. The tokens field is always zero unless the remote agent explicitly includes it in the response.
Failure Modes and Observability Gaps
| Failure Mode | Caller Sees | Remote Reality | Missing Primitive |
|---|---|---|---|
| Remote tool raises exception |
status=completed, generic error string |
Exception logged, task aborted | Structured failure signal in response |
| HTTP timeout before reply | Timeout error, no result | Write succeeded, reply prepared | Durable receipt correlation |
| Remote agent crashes mid-task | Timeout or connection error | Partial state, no cleanup | Idempotency token, state snapshot |
| Token counter incremented remotely |
tokens=0 in caller result |
tokens=2369 in remote logs |
Shared token ledger or response metadata |
| Network partition during invoke | Retry or timeout | Task may run twice | Idempotency key, deduplication |
The table shows five failure modes. None are handled by default. Each requires a custom solution.
What You Need to Build
If you run agents across process boundaries, you need:
- Token ledger: A shared counter or a response field that propagates token usage back to the caller.
- Failure signal: A structured error object in the A2A response, not a string in the body.
- Receipt correlation: A way to prove a write succeeded even when the reply times out. Options include polling a known file path, using a message queue for receipts, or embedding a receipt hash in the response.
- Idempotency: A task ID or invocation token that prevents duplicate execution when the caller retries after a timeout.
- State snapshots: A way to resume or roll back a remote task that crashes mid-execution.
None of these are in the A2A protocol today. You build them yourself or accept the gaps.
When to Use Cross-Process Orchestration
Use it when:
- You need to isolate agents for security, resource limits, or language boundaries.
- You want to scale agents independently (different instance types, regions, or clusters).
- You are composing agents from multiple teams or vendors.
Avoid it when:
- Token accounting matters and you cannot instrument the remote agent.
- Failure propagation must be precise and you cannot add structured error handling.
- Latency is critical and the HTTP round-trip is too expensive.
- You need transactional guarantees across tool calls.
Technical Verdict
Cross-process agent orchestration is not a protocol problem. It is a missing primitives problem. A2A defines how to serialize a task and parse a result, but it does not define how to account for tokens, propagate failures, or correlate receipts with replies.
If you control both sides of the boundary, you can extend the protocol with custom headers, response fields, or out-of-band signals. If you do not, you accept zero token visibility, opaque failures, and receipt timing gaps.
The Strands SDK marks A2A as experimental. That is the right label. The protocol works for discovery and invocation. It does not work for production observability or failure recovery without additional infrastructure.
Build the ledger, the failure signal, and the receipt correlation yourself, or keep your agents in one process.
Top comments (0)