Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Delivered message shape

telex wait prints one delivered message as JSON on exit 0. With --out-dir it writes the same message to message.json, and an envelope form to delivery.json ({ "message": {...}, "delivery": {...}, "status": {...} }). A pull-mode script or harness parses this to drive an agent.

Example

Output of telex wait --json for one delivered message:

{
  "id": 118,
  "thread_id": 118,
  "parent_id": null,
  "from": "demo:jsondoc",
  "to": "demo:jsondoc",
  "primary_to": "demo:jsondoc",
  "delivered_to": "demo:jsondoc",
  "delivery_role": "to",
  "cc": [],
  "kind": "note",
  "attention": "next-checkpoint",
  "requires_disposition": true,
  "requires_disposition_for_current_recipient": true,
  "subject": "Hello",
  "body": "world",
  "metadata": null,
  "sent_at_ms": 1783355088938,
  "buffered_at_ms": 1783355089013,
  "delivery_id": 321,
  "snapshot_version": 44,
  "lease_epoch": 1
}

Fields

FieldMeaning
idMessage id. Use it with ack, handle, read, and for dedupe.
thread_idRoot message id of the thread.
parent_idParent message id for a reply, otherwise null.
fromSender address; a reply routes here.
toThe address the message was sent to.
primary_toThe primary recipient address.
delivered_toThe recipient address this delivery is for.
delivery_roleto or cc: this recipient’s role in the message.
ccCC (observer) addresses.
kindMessage kind label (default note).
attentioninterrupt, next-checkpoint, background, or fyi.
requires_dispositionWhether the sender marked the message as requiring disposition.
requires_disposition_for_current_recipientThe same, scoped to this recipient.
subjectSubject, if any.
bodyMessage body.
metadataOpaque message metadata, if any.
sent_at_ms, buffered_at_msUnix millisecond timestamps.
delivery_idExact per-recipient delivery-row identity for this delivered JSON record. Legacy CLI ack still addresses message plus recipient; supported applications use the typed Application Client ack handle rather than parsing this field from CLI output.
snapshot_versionStore state fence captured with delivery selection.
lease_epochThe recipient station’s lease epoch at delivery.

Fields whose names end in _ms such as backend_ms, send_to_exit_ms, and waiter_exit_ms are timing diagnostics, not message content.

Consume by id

Delivery is at-least-once, so dedupe by id and ack it to consume it from the delivery buffer:

telex ack --address <addr> --id <id> --session <session-id>

Files written by --out-dir

  • message.json: the flat delivered message (exit 0 only).
  • delivery.json: the envelope { message, delivery, status } (exit 0 only).
  • status.json: { outcome, exit_code, detail, quarantine?, ... } (always). Exit 6 stores its structured evidence in quarantine and removes any stale message.json/delivery.json; it is not a delivered-message artifact. Exit 7 reports exhausted backend recovery as backend-unavailable.
  • exit.code: the integer exit code, written last as the completion marker.

Exit 7 applies when both the CLI and daemon support wait-backend-recovery. Legacy CLI artifacts instead contain outcome: "error", exit_code: 1, and BackendUnavailable detail. Daemon Status retains classification 7, but omits the new typed last_waiter_outcome for a requester that lacks the optional capability. That omission does not remove the detail or change the stored outcome.

See Exit codes.