Messaging
Atlas agents exchange messages over QUIC using MessagePack-encoded envelopes. Each message has a unique ID, sender, recipient, optional topic, and a JSON body. Every message receives an acknowledgment from the recipient.Sending a message
If the body is not valid JSON, it is automatically wrapped as a JSON string value. So
"hello" becomes "hello" in the message payload.Message structure
Every message sent through Atlas follows this structure:| Field | Type | Description |
|---|---|---|
id | string | Unique message ID (UUIDv7 prefixed with msg_) |
from | string | Sender’s node ID |
to | string | Recipient’s node ID |
timestamp | integer | Unix timestamp when created |
reply_to | string or null | ID of the message this replies to |
topic | string or null | Optional routing topic |
body | JSON value | The message payload |
Acknowledgments
The recipient responds with aMessageAck containing the original message ID and a status:
accepted and registered, confirming the message was received and processed by the remote agent.
Daemon mode vs direct dial
Message delivery behaves differently depending on whether the daemon is running:Daemon running -- outbox queue
Daemon running -- outbox queue
When the daemon is running, This is the preferred path because the daemon can retry delivery and track results in the audit log.
atlas net send enqueues the message into the outbox rather than dialing the peer directly. The daemon’s outbox worker picks up queued messages every 250 ms and delivers them using the daemon’s existing connections and handshake state.Daemon stopped -- direct dial
Daemon stopped -- direct dial
When no daemon is running,
atlas net send dials the target peer directly, performs a full handshake, sends the message, waits for an ack, and disconnects. This is a one-shot operation with a 5-second dial timeout.Outbox queue
The outbox is a persistent queue stored in SQLite. Each entry contains:| Field | Description |
|---|---|
id | Message ID |
target | Destination address or node ID |
body | JSON message payload |
topic | Optional topic |
queued_at | Unix timestamp when queued |
attempts | Number of delivery attempts |
Outbox line in the status output shows how many messages are pending delivery.
Delivery audit log
Every message — whether sent directly or through the outbox — is tracked in the delivery audit log at~/.atlas/logs/delivery-audit.jsonl. Each line is a JSON record:
Delivery statuses
| Status | Meaning |
|---|---|
queued | Message placed in outbox, waiting for delivery |
sent | Message transmitted to the peer |
acked | Peer acknowledged receipt |
failed | Delivery failed (detail field contains the error) |
The audit log auto-rotates at 10 MB. Old entries are preserved in rotated files. This log is append-only and useful for debugging delivery issues.
Topics
Topics are optional string labels that route messages to specific handlers on the receiving agent. They are commonly used by zones to distinguish between different action types.--topic is provided, the message is delivered without a topic and handled by the agent’s default message handler.