Agent-to-Agent Discovery in SMESH: Why Coordination Isn't Enough Without Runtime Introductions

Agent-to-Agent Discovery in SMESH: Why Coordination Isn’t Enough Without Runtime Introductions

SMESH 中的 Agent-to-Agent 发现机制:为何仅有协调是不够的,还需要运行时引入

You can build a working agent mesh with QUIC transport, encrypted messaging, and decentralized coordination. Five processes can reinforce independent conclusions and let unsupported signals decay. The mesh works. Then you try to introduce it to another agent and discover you have no standard way to ask what the swarm can do. No retained task to retrieve after an internal signal expires. No interoperable progress stream. No cancellation contract. No artifact another framework would understand. SMESH is a Rust-based decentralized agent framework that hit this boundary. The author had built a society with no border crossing. The solution was Google’s Agent2Agent (A2A) protocol, announced in April 2025 and moved under Linux Foundation governance in June 2025. A2A provides the missing public contract: a way for agents built by different vendors to discover one another, exchange messages, and collaborate without sharing private memory, tools, or internal plans.

你可以利用 QUIC 传输、加密消息传递和去中心化协调构建一个可用的 Agent 网格(Agent Mesh)。五个进程可以相互强化独立的结论,并让不受支持的信号衰减。网格运行良好。但当你尝试将其引入另一个 Agent 时,你会发现没有标准的方法来询问该集群能做什么。没有在内部信号过期后可检索的保留任务,没有可互操作的进度流,没有取消契约,也没有其他框架能理解的工件。SMESH 是一个基于 Rust 的去中心化 Agent 框架,它遇到了这个瓶颈。作者构建了一个没有边界跨越的“社会”。解决方案是 Google 的 Agent2Agent (A2A) 协议,该协议于 2025 年 4 月发布,并于 2025 年 6 月移交给 Linux 基金会管理。A2A 提供了缺失的公共契约:一种让不同厂商构建的 Agent 能够相互发现、交换消息并进行协作的方法,且无需共享私有内存、工具或内部计划。

The Cold-Start Problem in Agent Meshes

Agent 网格中的冷启动问题

Traditional service meshes solve discovery with a central registry. Kubernetes has etcd. Consul has its catalog. Envoy has xDS. You register your service, get a DNS name or IP, and other services find you. This works because services are relatively static and the registry is the source of truth. Agent meshes are different. Agents are ephemeral, context-dependent, and often spawned on demand. They need to: Discover peers without a central registry, Exchange capability metadata at runtime, Negotiate protocols without pre-shared configuration, Maintain security boundaries during introduction. The coordination primitives (message passing, consensus, signal decay) assume agents already know about each other. Discovery is the layer below coordination. SMESH had the top layer working but no way to bootstrap the bottom layer without manual wiring.

传统的服务网格通过中央注册中心解决发现问题。Kubernetes 有 etcd,Consul 有其目录,Envoy 有 xDS。你注册服务,获取 DNS 名称或 IP,其他服务就能找到你。这之所以有效,是因为服务相对静态,且注册中心是事实的来源。Agent 网格则不同。Agent 是短暂的、依赖上下文的,且通常按需生成。它们需要:在没有中央注册中心的情况下发现对等节点、在运行时交换能力元数据、在没有预共享配置的情况下协商协议、在引入过程中维护安全边界。协调原语(消息传递、共识、信号衰减)假设 Agent 已经相互了解。发现是协调之下的层级。SMESH 实现了顶层功能,但在没有手动配置的情况下,无法引导底层。

What A2A Provides

A2A 提供了什么

A2A is not a coordination protocol. It is an introduction protocol. The spec defines: Discovery handshake (How agents announce themselves and query peer capabilities), Capability exchange (Structured metadata about what an agent can do), Message envelope (Standard format for task requests, progress updates, cancellations, and results), Security boundary (Agents expose capabilities without revealing internal state, tools, or memory). This maps to the HTTP layer in microservices, not the application layer. A2A is the contract that lets heterogeneous agents talk. What they say after introduction is up to them.

A2A 不是一种协调协议,而是一种引入协议。该规范定义了:发现握手(Agent 如何宣告自己并查询对等节点能力)、能力交换(关于 Agent 能做什么的结构化元数据)、消息信封(任务请求、进度更新、取消和结果的标准格式)、安全边界(Agent 在不泄露内部状态、工具或内存的情况下暴露能力)。这对应于微服务中的 HTTP 层,而非应用层。A2A 是让异构 Agent 能够对话的契约。引入之后它们谈论什么,则由它们自己决定。

SMESH Architecture Before A2A

A2A 之前的 SMESH 架构

SMESH uses a decentralized coordination model: QUIC transport (Encrypted, multiplexed connections between agent processes), Signal propagation (Agents broadcast observations and reinforce conclusions from peers), Decay mechanism (Unsupported signals lose weight over time), No central orchestrator (Coordination emerges from peer interactions). The missing piece was the gateway layer. Agents inside the mesh could coordinate. Agents outside the mesh had no entry point. The author describes this as “a society with no border crossing.”

SMESH 使用去中心化协调模型:QUIC 传输(Agent 进程间加密、多路复用的连接)、信号传播(Agent 广播观察结果并强化来自对等节点的结论)、衰减机制(不受支持的信号随时间权重降低)、无中央编排器(协调从对等交互中涌现)。缺失的部分是网关层。网格内部的 Agent 可以协调,但网格外部的 Agent 没有入口。作者将其描述为“一个没有边界跨越的社会”。

Adding the A2A Gateway

添加 A2A 网关

The implementation added a tested gateway layer that: Exposes A2A-compliant discovery endpoints, Translates A2A task requests into SMESH internal signals, Maps SMESH coordination state to A2A progress updates, Handles cancellation by injecting decay signals. The gateway is not a proxy. It is a protocol adapter. Internal agents still use QUIC and signal propagation. External agents use A2A. The gateway translates at the boundary.

该实现增加了一个经过测试的网关层,它:暴露符合 A2A 标准的发现端点、将 A2A 任务请求转换为 SMESH 内部信号、将 SMESH 协调状态映射为 A2A 进度更新、通过注入衰减信号处理取消操作。网关不是代理,而是协议适配器。内部 Agent 仍然使用 QUIC 和信号传播,外部 Agent 使用 A2A。网关在边界处进行转换。

Discovery Flow

发现流程

Here is how an external agent discovers and tasks a SMESH mesh: Capability query (External agent sends A2A discovery request to gateway), Gateway response (Returns aggregated capabilities from internal agents), Task submission (External agent sends A2A task request with inputs), Internal translation (Gateway converts task to SMESH signal and broadcasts to mesh), Coordination (Internal agents reinforce or decay the signal based on their observations), Progress streaming (Gateway polls internal state and emits A2A progress updates), Result or cancellation (Gateway returns final result or handles cancellation via decay injection). The gateway maintains no task state. It is a stateless translator. Task retention happens inside the mesh via signal persistence.

以下是外部 Agent 如何发现并向 SMESH 网格下达任务的流程:能力查询(外部 Agent 向网关发送 A2A 发现请求)、网关响应(返回来自内部 Agent 的聚合能力)、任务提交(外部 Agent 发送带有输入的 A2A 任务请求)、内部转换(网关将任务转换为 SMESH 信号并广播到网格)、协调(内部 Agent 根据观察结果强化或衰减信号)、进度流(网关轮询内部状态并发出 A2A 进度更新)、结果或取消(网关返回最终结果或通过注入衰减信号处理取消)。网关不维护任务状态,它是一个无状态的转换器。任务保留通过信号持久化在网格内部完成。

Security Boundaries

安全边界

A2A enforces separation between public and private state: A2A 强制执行公共状态与私有状态的分离:

LayerExposedHidden
CapabilitiesTask names, input/output schemas, supported protocolsTool implementations, internal prompts, model weights
Task stateProgress percentage, status enum, public artifactsInternal signals, peer votes, decay timers
CoordinationFinal consensus resultSignal propagation graph, reinforcement weights
TransportA2A HTTP/JSON or gRPCQUIC connections, encryption keys, peer topology
层级暴露内容隐藏内容
能力任务名称、输入/输出模式、支持的协议工具实现、内部提示词、模型权重
任务状态进度百分比、状态枚举、公共工件内部信号、对等节点投票、衰减计时器
协调最终共识结果信号传播图、强化权重
传输A2A HTTP/JSON 或 gRPCQUIC 连接、加密密钥、对等拓扑

The gateway is the trust boundary. Internal agents trust each other (authenticated via QUIC). External agents trust only the gateway’s A2A contract.

网关是信任边界。内部 Agent 相互信任(通过 QUIC 认证)。外部 Agent 仅信任网关的 A2A 契约。

Testing Discovery Without Flaky Timing

在没有不稳定性时间依赖的情况下测试发现机制

The author mentions the gateway is tested but the six-organization incident is a deterministic simulation. This is the right approach. Testing decentralized discovery is hard because: Timing dependencies cause flakes, Network partitions are non-deterministic, Signal decay depends on wall-clock time. The solution is to separate gateway tests from mesh tests: Gateway tests (deterministic): Mock internal mesh state, Verify A2A request/response contracts, Test cancellation translation, Validate schema mappings. Mesh tests (simulation): Inject deterministic signals, Advance virtual time, Verify coordination without external A2A layer. This keeps the A2A boundary testable without requiring a full mesh spin-up.

作者提到网关经过了测试,但“六组织事件”是一个确定性模拟。这是正确的方法。测试去中心化发现很难,因为:时间依赖会导致不稳定性、网络分区是非确定性的、信号衰减依赖于挂钟时间。解决方案是将网关测试与网格测试分离:网关测试(确定性):模拟内部网格状态、验证 A2A 请求/响应契约、测试取消转换、验证模式映射。网格测试(模拟):注入确定性信号、推进虚拟时间、在没有外部 A2A 层的情况下验证协调。这使得 A2A 边界在无需启动完整网格的情况下即可进行测试。

What Is Still Missing

仍然缺失的内容

The author notes several gaps: Task retention (No way to retrieve a task after its internal signal expires), Interoperable progress stream (A2A progress updates exist but are not standardized across meshes), Cancellation contract (De…).

作者指出了几个缺口:任务保留(在内部信号过期后无法检索任务)、可互操作的进度流(A2A 进度更新存在,但在不同网格间未标准化)、取消契约(De…)。