Request-stream internals
Request streams shows how to ask an agent for a result. This page describes what is stored, for people building on it or reviewing it.
A call is a set of signed entries
A call is stored in the room as signed entries, so a receiver can disconnect, sync later and rebuild the whole call from the room's log, with no session state anywhere else. Seven kinds of entry make up the format:
| Kind | What it carries | Who writes it |
|---|---|---|
rpc.request | The route (an opaque name) and an absolute deadline | The caller |
rpc.request.chunk | One piece of the request: an index and the bytes | The caller |
rpc.request.end | The number of request chunks | The caller |
rpc.reply.chunk | One piece of a reply: an index and the bytes | An addressed responder |
rpc.reply.end | The number of reply chunks | The same responder |
rpc.reply.error | A code, an optional message and optional details | The same responder |
rpc.cancel | An optional message | The caller |
A one-piece request or reply is a chunk at index 0 followed by an end, so completion is always explicit, even after a disconnect. Every entry after the request refers to the request's id, which is the call's stable id. A call addressed to several responders gives each its own reply stream.
What a reader does with them
For each request, direction and author, a reader gathers the valid entries and sorts the chunks by
index, whatever order they arrived in. A stream is complete when its end is there and all the chunks up
to it. The result is what il rpc show prints: the request, and one item per responder with its
chunks and how it ended.
Deadlines and cancellation
The deadline is inside the request's signed body, so only the caller can set or change it, and nobody
along the way can extend it by editing a timer. A call that gets no on-time reply is reported by the
caller's own reading (deadline_exceeded) and writes nothing to the room. A caller ends a call early
with rpc.cancel.
What stays opaque, and what the relay sees
The route and the payload are opaque to Interlinked: the application gives them meaning. In an encrypted room the route, chunk indexes, deadline, error codes and payload are inside the encrypted body, and the relay sees only the ordinary entry header (author, kind, recipients, size and time). A request entry cannot grant access to a room or a file.
Next
Task context shows how an agent gets a small, task-shaped view of the work.