Armadra

概念

消息与交接

收件箱、投递与对话交接,三种在 Agent 之间传递工作的方式,以及你在界面上怎么控制它们。


两个 Agent 连线之后,它们有三种传递工作的方式,适用场景不同。前两种由 Agent 自己发起,第三种由你在界面上发起并确认。

方式 谁发起 适合
收件箱(拉取) Agent 阶段性汇报:结果、证据、需要对方判断的问题
投递(推送) Agent 需要对方马上开始做某件事
对话交接 你 把一段工作整理成一份资料,交给另一个 Agent 接着做

消息只能发给有连线、且在同一工作空间的 Agent,连线怎么建与两种关系见连线与上下文。

收件箱(拉取)

最常用、最安静的方式。发送方完成阶段性工作后存一条短消息:结果、证据文件路径、需要对方判断的问题。接收方在需要时主动查看收件箱,处理完再确认。

  • 应用不会自动把消息粘进对方终端,也不会替对方按回车。
  • 读取不消耗消息,确认才算接下。
  • 一条消息正文最多 2000 个字符,保留 24 小时;每个接收方最多积压 64 条未确认的消息。
  • 存入成功只表示消息已存下,不表示对方看过或做完。

在画布启动的终端里,Agent 通过随包的 armadra-hook 使用这些动作,例如:

armadra-hook canvas post --to <节点> --key review-1 --body '构建已通过,请审查 src/api.ts 的错误返回。'
armadra-hook canvas inbox
armadra-hook canvas ack --id <消息>

一般不需要你手敲:画布技能会告诉 Agent 什么时候用哪一个。

让对方更快注意到

默认情况下,接收方空闲时发现有未读消息,会收到一行提示去看收件箱。可以在接收方节点的右键菜单「Agent 设置…」里调整「收件箱唤醒」:

  • 关:什么都不做,等它自己查看;
  • 提示(默认):空闲时推一行提示;
  • 直接投递:空闲时把消息直接投进它的终端。

投递(推送)

需要对方马上开始时,Agent 用 canvas send 把一句任务投进目标终端。投递会排队,等目标空闲、停在提示符上、没有半截输入时才写入;休眠的目标先唤醒再投;目标正停在 CLI 的启动对话框上则不会写入。投递结果会作为回执回到发送方的收件箱。

canvas interrupt 只给目标发一个 Esc,用来打断跑偏的一轮,不带任何文字,也不需要目标空闲。

谁能向谁投递由连线关系决定:「共享上下文」双向都可以;「派发」只有派发方能向被派发方投递与打断,反过来要在派发方的「Agent 设置…」里打开「允许从向我投递」。

对话交接

把一段阶段性工作整理成一份冻结的交接包,交给另一个 Agent。适合换人接手、换个模型继续、或把一次长对话压缩成一份清楚的任务说明。

  1. 在来源 Agent 节点头部的「更多」里选「交接到…」。没有连线目标时会提示「先在画布上连一条线到另一个 Agent 节点」。
  2. 选「目标 Agent」:画布上已连线的 Agent 节点,或「新开 Agent…」——后者再选 Agent、模型、权限模式与形态(终端或 ACP),确认后才会真的新建节点。
  3. 填写交接内容:「目标」必填,「约束」「完成标准」「已完成」「未完成」「关键决策」「工具结果摘要」可空,还可以列出要带走的「文件引用」,并选择是否「带上来源转录摘录」。
  4. 点「预览」。预览里列出目标 Agent、模型与目录,「带走的文件」与「Git 指纹」,按预算裁剪后的内容(会注明「内容已按预算裁剪」),以及「未包含或需要留意」的项目。预览阶段没有通知任何人。
  5. 点「确认交接」:交接包进入目标的收件箱。看到的和批准的必须是同一份;预览冻结之后来源又有新活动时,会标出「快照之后来源又有新活动」。点「返回编辑」可以改,「撤回」可以取消。

交接有四个状态,只说这一侧能证明的事:「已冻结,等待确认」「已放进目标的收件箱」「目标已确认收到」「已撤回」。进了收件箱不等于对方看过、做过或做完,也不会往对方终端里写任何东西,什么时候读、怎么处理由目标自己决定;新开 Agent 时交接包作为新节点的首个任务排队。

要点:

  • 交接包是资料,不是指令;会话里已有的权限批准不随交接转移,凭据不进入交接包。
  • 来源会话继续运行,不受影响。
  • 在 Agent 节点右键菜单的「交接历史」里可以查看本节点的所有交接、来源与目标、冻结时间与最近状态。
  • 有交接等你确认时,侧栏通知里会出现「交接待确认」。

Concepts

Messages and handoff

Inbox, delivery and conversation handoff — three ways to pass work between agents, and how you control them in the UI.


Once two agents are linked they have three ways to pass work along, each for a different situation. The first two are started by the agents themselves; the third is started and confirmed by you in the UI.

Way Started by Good for
Inbox (pull) Agent Milestone reports: results, evidence, questions for the other side
Delivery (push) Agent The other side should start on something right now
Conversation handoff You Packaging a stretch of work as material for another agent to continue

Messages can only go to agents that are linked and in the same workspace; how to create links and the two relationships are covered in Links and context.

Inbox (pull)

The most common and quietest way. After a milestone the sender stores a short message: the result, paths to evidence, and the specific question for the other side. The receiver checks its inbox when it needs to and acknowledges once done.

  • The app never pastes the message into the other terminal or presses Enter for it.
  • Reading doesn’t consume a message; acknowledging means “I’ve taken this”.
  • A message body is at most 2000 characters and is kept for 24 hours; each receiver can hold at most 64 unacknowledged messages.
  • A successful post only means the message was stored, not that the other side has seen or finished it.

In terminals launched from the canvas, agents use these actions through the bundled armadra-hook, for example:

armadra-hook canvas post --to <node> --key review-1 --body 'Build passes. Please review the error handling in src/api.ts.'
armadra-hook canvas inbox
armadra-hook canvas ack --id <message>

You usually don’t type these yourself: the canvas skill tells the agent which one to use and when.

Getting the other side’s attention sooner

By default, when the receiver is idle and has unread messages it gets a one-line prompt to check its inbox. Change this under “Inbox wake” in the receiver node’s right-click menu, “Agent settings…”:

  • Off: nothing happens; it checks when it checks;
  • Notify (default): a one-line prompt while idle;
  • Deliver: the message is delivered straight into its terminal while idle.

Delivery (push)

When the other side should start right away, the agent uses canvas send to deliver one task line into the target terminal. Deliveries queue and are written only when the target is idle, sitting at its prompt and has no half-typed input; a hibernated target is woken first; a target sitting at a CLI start-up dialog is not written to. The outcome returns to the sender’s inbox as a receipt.

canvas interrupt sends the target a single Esc to stop a run that went off track; it carries no text and doesn’t need the target to be idle.

Who may deliver to whom follows the link relationship: with “Shared context” both ways are allowed; with “Dispatch” only the dispatcher may deliver to or interrupt the dispatched side, and the reverse needs “Let subs type into my terminal” turned on in the dispatcher’s “Agent settings…”.

Conversation handoff

Package a stretch of work into a frozen handoff bundle and give it to another agent. It suits changing hands, continuing with a different model, or condensing a long conversation into a clear task brief.

  1. In the source agent node’s header choose “More” → “Hand off to…”. With no linked target you are told “Link this node to another agent node on the canvas first.”
  2. Pick the “Target agent”: a linked agent node on the canvas, or “New agent…”. The latter lets you choose the agent, model, permission mode and surface (Terminal or ACP), and the node is only created after you confirm.
  3. Fill in the content: “Goal” is required; “Constraints”, “Acceptance criteria”, “Completed”, “Still open”, “Key decisions” and “Tool result summary” are optional. You can also list “File references” to carry along and choose whether to “Include a source transcript excerpt”.
  4. Click “Preview”. It lists the target agent, model and folder, “Files carried over” and the “Git fingerprint”, the content trimmed to the budget (“Content was trimmed to fit the budget.”), and anything “Left out or worth knowing”. Nobody has been notified at this point.
  5. Click “Confirm handoff”: the bundle enters the target’s inbox. What you saw and what you approved must be the same bundle; if the source does more work after the snapshot, the preview says “The source has done more work since this snapshot.” Use “Back to editing” to change it or “Withdraw” to cancel.

A handoff has four states, each a fact this side can prove: “Frozen, waiting for your confirmation”, “In the target’s inbox”, “The target acknowledged it” and “Withdrawn”. Being in the inbox doesn’t mean the other side has seen it, acted on it or finished; nothing is written into its terminal, and when and how it reads the bundle is its own decision. With “New agent…” the bundle is queued as the new node’s first task.

Good to know:

  • A bundle is material, not an instruction; permission approvals already granted in the session don’t transfer, and credentials never enter the bundle.
  • The source session keeps running.
  • “Handoff history” in an agent node’s right-click menu lists all handoffs for that node, with source and target, when each was frozen and its latest state.
  • When a handoff awaits your confirmation, “Handoff” shows up in the sidebar notifications.

在 GitHub 上编辑本页 Edit this page on GitHub