Skip to content

Run an agent (AG-UI 1.0 HTTP + SSE binding)​

POST
/agui/agents/{agentId}

The standard AG-UI run endpoint (ADR 0012, agui.md). Creates a thread (the consumer mints threadId, a UUID), sends a message, answers an interrupt (resume), sends the user's action on an A2UI surface (forwardedProps.a2uiAction.userAction, ADR 0013) or attaches to a run already in the log (a retry with the same runId). The response streams the AG-UI events of that run, from RUN_STARTED to RUN_FINISHED or RUN_ERROR, then ends; closing it never cancels the run.

A run whose threadId names no thread may create it as a fork with forwardedProps["vymalo.fork"] = {from, after} (ADR 0042, decisions 8 and 9, agui.md): the parent's events up to the end of the turn that holds after, thread_forked and the run's message are one transaction, and the response is the run that message opens, from its RUN_STARTED, nothing of the copied turns. It needs thread.write on from (the caller's own thread, else 404) and agent.invoke on the run's agentId, which may be another agent than the parent's; vymalo.mentions and vymalo.uiCatalog apply to the message, and it is a 400 together with vymalo.gate or vymalo.tools (a fork has the deployment's gate and its parent's tools). The member is read on a run that creates the thread; a thread that exists already answers it only when it is the fork the same request made (the same from, after and runId, the same person's): the replay, which attaches to the run and writes nothing, so a resend after a lost response is safe. Any other existing thread is a 409.

A run that carries a message may name the access tier the agent works under for it with forwardedProps["vymalo.tier"] (plan, edits, auto or bypass, ADR 0061, access-tier-v1.md, agui.md). It is read on every run (a member that is not one of the four words is a 400), checked against the person's role cap (auth.roles.<role>.maxTier: 422) and the thread's agent's live card (422 when it does not honour the tier, 503 when it cannot be read) before anything is written, and never silently dropped; it is logged on the user_message (tier), shown on the message's TEXT_MESSAGE_START metadata (vymalo.tier) and sent to the agent only while its card still honours it. A message that names none is not always sent as plain A2A: a person whose roles cap the tier for this agent is given the highest tier the agent offers that is not above the lower of its default and the cap (422 when it offers none), an answer to a blocked job or an action on a surface continues the tier of the job, lowered to the cap and the card, and a person with no cap who names none is sent the message it always was. What the message was sent under is what the log says. The tiers an agent honours, and the highest the person may pick of that agent, are in getAgentCapabilities; maxTier of getMe is a hint.

A run that carries a message may also pick the model and the reasoning effort the agent answers with, with forwardedProps["vymalo.model"] (an alias the agent's card offers: 1 to 64 characters of a-z0-9._-) and forwardedProps["vymalo.reasoningEffort"] (none, minimal, low, medium, high, xhigh or max), ADR 0086, model-pick-v1.md. Each is read on every run (a value that is not one is a 400). A pick is not a hint: the message's own pick wins, then the thread's default (patchThread), then the agent's own default, and the result is checked against the thread's agent's live card before anything is written: a choice the card does not list is a 422 with code: model_not_offered or code: reasoning_not_offered and offered, the list the card offers (empty when it lists none), and nothing is written; a card that cannot be read is a 503. The resolved pick is logged on the user_message (pick: {model?, reasoningEffort?}, omitted when none), so a redelivery, a fork's first message, an edit and an export carry it; it is sent to the agent only while its card still offers it, and an agent that answers InvalidParams leaves the message undelivered, never retried without the pick.

On a child thread (ADR 0072) the run is a message to the helper session: with the session idle it is the helper's next round, with a round working and vymalo.send: steer a steer into it, with the round waiting for the person (blocked) the answer to it. A Stop & send (vymalo.send: interrupt) is allowed only for a kept-open session. A message that mentions agents is refused (a helper cannot ask other agents). What only the agent can refuse (its limit of rounds working at once, of rounds per session) ends the job with error carrying the agent's own words.

Every rejection is decided before the first stream byte and is a problem response; nothing was written. Cancel a run with cancelThread.

A message over the person's role's messages_per_minute (auth.roles.<role>.limits.messagesPerMinute, ADR 0081, decisions 2 and 4) is refused before anything is written and before any agent is asked: 429 with Retry-After (the whole seconds until the oldest message of the last minute leaves it) and a problem that names the limit and its value: code: over_limit, limit: messages_per_minute, inUse (the messages the minute holds) and max (the role's value). The count is the person's user_message events of the last minute, read from the log, so every replica counts the same and a restart loses nothing; a role that sets no limit, and a deployment that sets none, refuses nothing.

Authorizations​

bearerToken

A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.

Type
HTTP (bearer)
or
dpopToken

A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".

Type
HTTP (DPoP)
or
proxyIdentity

Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.

Type
API Key (header: X-Auth-Request-Email)

Request Body​

JSON
{
  
"threadId": "00000000-0000-4000-8000-000000000001",
  
"runId": "run-0001",
  
"protocolVersion": "1.0",
  
"messages": [
  
  
{
  
  
  
"id": "msg-0001",
  
  
  
"role": "user",
  
  
  
"content": "Fix the failing login test"
  
  
}
  
],
  
"forwardedProps": {
  
  
"vymalo.tier": "edits"
  
}
}

Responses​

The run's events (text/event-stream); frames carry id: on resume points

text/event-stream
JSON
"data: {"type":"RUN_STARTED","protocolVersion":"1.0","threadId":"00000000-0000-4000-8000-000000000001","runId":"run-0001"} data: {"type":"TEXT_MESSAGE_START","messageId":"evt-2","role":"assistant"} data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"evt-2","delta":"I found the failing assertion."} data: {"type":"TEXT_MESSAGE_END","messageId":"evt-2"} id: 3 data: {"type":"RUN_FINISHED","threadId":"00000000-0000-4000-8000-000000000001","runId":"run-0001"} "

Samples​

Powered by VitePress OpenAPI