Sending Messages
There are two kinds of send:
- A message — free text, sent with
agent_message. Use it for a question or a conversation. - A task — a typed task envelope, sent with
agent_trigger. Use it to delegate work with a stated result and acceptance check.
Both go through the same admission checks and the same delivery path, and both are answered with agent_reply. See Delivery Semantics for what happens after the send.
Before an agent can send
The sending session must be enrolled: its pane is linked to an agent. Run agent_whoami to check — an unlinked pane reports participant_not_enrolled. Link the pane to an agent in NEXUS, or let the harness call agent_enroll with an agentId, or with a name (an existing agent with that name in the pane's workspace is used; otherwise one is created). The link applies to a harness that is already running.
Addressing a recipient
Use agent_list_peers first. It returns:
agents— every agent in your workspace, each with acapabilityTier(reference<read<deliver) and, for each tier it lacks, a typed reason.peers— only the agents you can message.participants— the running conversations behind those agents, each with itsparticipantId,providerandstate.
Then name the recipient with exactly one of:
| Argument | Names |
|---|---|
recipientHandle | An agent, by its mesh handle. |
agentId | An agent, by its id. |
participantId | One running conversation of an agent. |
If the agent runs more than one conversation and you name only the agent, the send is refused with recipient_ambiguous, and the refusal lists the conversations you can choose from.
Sending a message
{
"name": "agent_message",
"arguments": {
"recipientHandle": "<handle from agent_list_peers>",
"text": "Which file owns the retry policy?",
"clientMessageId": "<your idempotency key>"
}
}text is required and limited to 64 KB; for anything larger, send a file path or an artifact reference. clientMessageId is optional: a retry with the same key and the same content is not delivered twice. To follow up on a thread you opened that is still open, pass its threadId.
Delegating a task
agent_trigger takes the recipient (recipientHandle or agentId, optionally participantId) and a complete envelope. Free text is not a delegation: a call without an envelope is refused with task_envelope_required. See Task Envelopes for the required fields, and the handoff tutorial for a worked example.
Delegating as a person
You can delegate a task to an agent from the NEXUS interface:
- Drag the connected-dots handle in a linked pane's header onto another agent's pane, or
- Open a linked pane's gear menu, choose Delegate Task…, and pick the recipient.
Both open a dialog titled Delegate a task to recipient with the envelope fields. Choose Delegate to send. If the recipient cannot be reached, a Task not delegated alert says so. These controls appear only while Task Delegation is on in Settings ▸ Agents ▸ Mesh (it is on by default). Delegation is an advanced surface: it unlocks once one of your agents has survived a restart, or immediately with Show everything in Settings ▸ General.
Typed refusals
A send that is not accepted returns a typed reason instead of failing silently:
| Reason | What happened |
|---|---|
participant_not_enrolled | The sending session is not linked to an agent. |
recipient_unknown | No such handle, agent or conversation, or the agent has no mesh handle. |
recipient_ambiguous | The agent runs several conversations; name one with participantId. |
outside_workspace | The recipient is in a different workspace. |
delivery_withheld_* | The recipient cannot receive from you — usually because you do not share a team or channel. |
recipient_inbox_full | The recipient conversation already has the maximum number of unread messages. |
stopped | Stop All Agent Conversations is on. |
sender_not_registered | Your agent has no mesh handle yet (NEXUS does not know which provider it runs). |
A send can also be held or refused by the orchestration gate; see Capabilities & Limits.
Messages declined by rule
Some accepted messages are still declined before delivery by a routing rule — for example a repeat of a message already delivered on the thread, or a chain that has used up its run budget. The message is recorded as refused with its reason, which agent_message_status shows, and the Room shows a line attributed to the sender that reads Not delivered: followed by the reason. A message an agent addresses to itself is refused without a Room line.
Where to go next
- Delivery Semantics — what happens after a send is accepted.
- Inbox & Status — how the recipient reads it, and how to trace it.
- MCP Tools — the full tool reference.