Skip to content

Remote channels

Agent Runtime 可以在本地进程、远程服务、浏览器扩展、IDE、移动端或 workflow worker 之间运行。标准不规定传输层,但规定远程通道必须保留 identity、权限、恢复和事件语义。

Channel identity

每个 channel SHOULD 有:

Field含义
channel_id稳定通道 id。
transportwebsocketssejson_rpcgrpchttp_jsonstdioin_process 或 custom。
peer_roleclienthostworkerremote_runtimepeer_agenttool_server
account_refHost 账号或租户引用。
capabilities支持 streaming、resume、permissions、files、artifacts、task delegation 等。
last_seen_at最近心跳或事件时间。
resume_token_ref可选恢复 token 引用。
native_protocol可选 peer protocol,例如 a2amcpjson_rpc 或 custom。

Remote session ingress

远程输入进入 runtime 时,SHOULD 标准化为 control plane action,而不是直接写 transcript:

  1. authenticate / enroll channel。
  2. resolve session、thread 和 workspace scope。
  3. submit turn、create task、append remote input 或 link peer task。
  4. emit channel events。
  5. persist read models、native ids 和 recovery cursors。

A2A alignment

当 peer 使用 Agent2Agent Protocol 时,runtime SHOULD 把 A2A 视为 peer transport 与 interaction contract,同时继续让 Agent Runtime 负责内部执行真相。

A2A conceptRuntime mapping
Agent CardPeer capability snapshot、routing input、channel.capabilities 与可选 agent_card_ref
SendMessage / SendStreamingMessage视 scope 映射为 submit_turncreate_taskappend_task_progress 与 channel events。
A2A taskId / contextId关联到本地 task_idparent_task_idsubagent_idchannel_idremote_task_ref
A2A Task state归一化 task status 加 native_status;不要覆盖 retries 或 local attempts。
MessageRemote input、clarification、status 或 task interaction;不要把 message 当成 durable task output。
Artifact / TaskArtifactUpdateEventArtifact refs、artifact.changed,以及 produced/consumed artifact task graph edges。
Streaming / subscribe / push notificationschannel.connectedchannel.messagetask.progresstask.completedchannel.resumed、ack、cursor 和 snapshot repair facts。
In-task authorizationaction.requiredpermission.requestedchannel.permission_forwardedchannel.permission_returned

Runtime MAY 暴露 A2A adapter,但 adapter 必须同时保留两套身份:本地 runtime task_id 与远端 A2A taskId / contextId

Remote permission bridge

远程 runtime 的权限决策必须可追踪:

  • 哪个 peer 请求权限。
  • 请求作用于哪个 tool/process/action。
  • 本地还是远程 host 做最终裁决。
  • 用户响应、timeout 或 policy deny 的来源。
  • 决策是否只对当前远程 channel 有效。

远程审批不应被压扁成普通 user message。

Event classes

Event何时发出
channel.connectedpeer 建立可用连接。
channel.disconnectedpeer 断开或心跳超时。
channel.resumed使用 cursor 或 token 恢复。
channel.message非 turn 的通道级消息或状态。
channel.permission_forwardedpermission request 跨 channel 转发。
channel.permission_returned远端或本地裁决返回。
channel.peer_task.linkedremote peer task 关联到本地 task 或 subagent。
channel.peer_task.updatedremote peer task 状态变化。

Recovery

客户端重连 SHOULD 先读取 snapshot,再从 last acknowledged sequence 继续。Runtime 不能 replay 时,必须发出 snapshot repair 事实并标记缺口。

远程任务恢复 SHOULD 区分:

  • remote session 仍在 running。
  • remote session idle 但未完成。
  • remote peer task 正在等待 input 或 authorization。
  • remote peer task 已完成但本地 delivery 尚未 reconcile。
  • remote session archived 或 missing。
  • auth / network 暂时不可用。

这些状态不应都显示成 failed。

反模式

  • 远程消息直接写 UI,不进入 runtime event stream。
  • 把 A2A taskId 当成本地 task_id,导致 peer 边界丢失。
  • 用 A2A message 充当 durable output,而不是 artifact refs。
  • 重连后从头重复投递,产生重复 turn。
  • 远程权限由浏览器或 host 私下批准,evidence 里没有记录。
  • channel 断开导致 running peer task 被错误标记 completed。

Draft standard for portable agent execution runtimes.