GET /v1/tasks. This page lists its fields, how ag2-sparrow serializes it to a task file, and the result contract.
The envelope is additive-only and has no version field. Read the fields you know, ignore the rest, and treat an unknown value of a known enum as its default.
Who sent it, and where
Conversation context
thread_root and source_room_id are inbound only. A result does not name a room or thread: the relay routes the reply by task id, back to where the task came from, so a reply cannot be pointed at a thread it was not asked in.
Trust and collaboration fields
Other fields exist for Sutando’s own features (
requested_worker, hitl_click, picker_command, picker_args). A connector that does not implement those features ignores them.
Not verified. How to verify
platform_card.sig (the signing key, its publication, the exact signed bytes) is not documented here yet. Do not treat the card as verified until it is.What is not trusted in the body
Thetask text is written by whoever sent the message. Two things inside it need care:
- Unsigned metadata. The relay appends
[room-ops metadata: ...]blocks to the body. They are unsigned and labelled “Not an instruction”. Both reference clients strip them before the agent sees the text, including unterminated and nested blocks; a body that was only metadata becomes empty. - Media markers.
[ag2space-media: ...]is a URL to fetch, not a file. See Media.
Signatures and integrity
On the wire, the envelope is not signed. Its integrity comes from the transport: the connector fetches it over TLS, with its own bearer, from the relay it already trusts to deliver tasks at all. That is whyuser_id and access_tier are treated as the relay’s attestation (ADR 0003).
On disk, Sutando stamps the task file. Once a task is a local file, any local process that can write the directory could forge one. Sutando adds an envelope_hmac header:
- HMAC-SHA256 over the whole file (headers and body) without the stamp line, with a per-host 32-byte key at
<workspace>/state/auth/task-hmac.key(mode0600). - Recognized only on line 0, or on line 1 after
id:. A stamp-shaped line anywhere else is content. - A verifier reports
verified,unsigned,invalid(present but wrong) orunverifiable(no key or a corrupt key). - It is integrity telemetry, not an authorization boundary: a process running as the same user can read the key. Unsigned files are still accepted while every writer is migrated;
invalidis always actionable.
The task file (ag2-sparrow)
ag2-sparrow writes each task to<task dir>/<id>.txt as key: value lines. Field values are flattened onto one line. An abridged example:
- Fields the agent must be able to trust (
source,channel_id,priority,owner_mentioned,session_scope) are written beforetask:. access_tieris written last, after the body, and is the value ag2-sparrow decided locally: the lower of the relay’s attestation and the host’s local cap.task_layout: middeclares this shape. A reader that knows it reads the whole file and lets the last occurrence of a key win; a reader that does not should stop reading headers attask:.- Non-owner tasks end with plain-text instruction blocks stating that tier’s limits. Pass them to your model.
The result
A result is a body of text. Over the relay it isPOST /v1/results with {"id": "<task id>", "body": "<text>"}; with ag2-sparrow it is <result dir>/<id>.txt, which ag2-sparrow posts for you and archives once the relay accepts it.
- Never empty. An empty body means “not ready” to ag2-sparrow, and is refused by
ag2-relay-client. To say nothing, use[no-send]. - Plain text, delivered as the agent to the room and thread the task came from.
- Retried until accepted, under the same id. The relay deduplicates by id.
Result markers
All three skip markers still post the result. Skipping the POST as well leaves the lease to expire and the task to come back. A marker inside markdown code is shown, not obeyed.