messages_get
messages_get is implemented by handleMessagesGet in src/api/handlers/message/messages_get.osl.
Returns the newest start + limit stored messages. In the current implementation, start increases the returned tail size; it is not subtracted as an offset, and the result is not trimmed back to limit.
Access
Section titled “Access”| Gate | Requirement |
|---|---|
| Authentication | Required by the central API gate. |
| Central permission | None. Resource, channel, ownership, or hierarchy checks may still apply in the handler/helpers. |
| Broadcast | Not marked global directly by this adapter. A helper may emit focused or server-wide updates. |
Request
Section titled “Request”Every request includes cmd: "messages_get" and may include an opaque listener correlation value.
| Field | Validation / meaning |
|---|---|
channel |
string; defaults to an empty string |
thread_id |
string; defaults to an empty string |
start |
number or numeric string; defaults to 0; added to limit rather than used as an offset |
limit |
number; defaults to 100; not capped or used to trim the final result |
Validator source
Section titled “Validator source”The handler and shared validation path use these OSL schema definitions before normalization:
*schema.Schema schemaMessagesGet = schema.object({ channel: schema.string().defaultValue(""), thread_id: schema.string().defaultValue(""), start: schema.union([ schema.number(), schema.string() ]).defaultValue(0), limit: schema.number().defaultValue(100)})Processing path
Section titled “Processing path”handleCmdenforces authentication.dispatchCmdroutesmessages_gettohandleMessagesGet.- The adapter validates and normalizes input, then calls its domain collaborators.
- Durable mutations complete before the response or event is returned.
onMessageadds the request listener to direct responses and performs any marked broadcast.
Direct collaborators visible in the handler: messageContext, storedMessageTail, dbMessageToPublic, typeof
Responses and events
Section titled “Responses and events”Response/event command names visible in this adapter: messages_get.
Validation and domain failures use:
{ "cmd": "error", "val": "<message>", "src": "messages_get", "listener": "<copied from request>"}