Fork a thread from a point, or branch it by editing a message
Makes a new thread that begins as a copy of this one (ADR 0029): the parent's events up to a cut, with the same seq, then a thread_forked event, then the new thread's own. The parent is not changed. The fork has its own A2A context, the parent's title (a person's rename of the parent stays theirs in the fork), the deployment's gate for its agent, and the same owner.
after(aseq): fork from here. The cut is the end of the turn that holds that event: the last event before the next message or action of a person, or the end of the log. The fork isdone, a finished job: its next message starts the next job and is sent to its agent with the earlier conversation in front of it. A turn that is still going on (the thread isqueued,workingorverifying, and nothing follows the event) cannot be copied: 409,code: turn_open. Withtarget, this is also "continue with another agent".afterwithtext(andmessageId): the fork is made with its first message (ADR 0042, decision 8). The copy,thread_forked, the message and the next job's start are one transaction, as for a new thread, so the fork isqueuedat once and its agent is told the conversation it continues together with the message; nothing exists if any part is refused. This route carries no mentions and no UI catalog: the AG-UI run (runAgent,forwardedProps["vymalo.fork"]) does, and is what the web sends. A repeat with the sameid, the sameafterand the same message answers the fork it made (200) and writes no second message; the sameidwith another message or cut is a 409.replace(theseqof a person's message) with the newtext: edit. The cut is the event before that message, which may be 0; the fork then holds the new message, the next job's start and its delegation to the agent, and isqueued. The thread is a branch of the one it was made from: it is left out oflistThreadsunless asked for, andlistBranchesfinds its siblings. A conversation holds at most 256 threads, its first thread and the threads made from it this way: the 256th edit is a 409.
Regenerate the last answer is an edit with the same words; the server has no route of its own for it (ADR 0029, amended 2026-11-14). A client does this:
- Take the person's message that began the newest turn and
POST{id, replace: <its seq>, text: <its words, unchanged>, messageId}. Send notierand nolocale: the server then keeps the replaced message's tier and interface locale (below). The answer is a new version of that message:listBranchesfinds it, and the client goes to the new thread. idandmessageIdare new UUIDs for each regenerate and the same ones for a retry after a failure (a lost response, a 5xx), so a retry never makes a second thread; the next regenerate, of the same message too, mints new ones.- Do not offer it when the client can see, from what the API gives it, that the edit would lose something: the thread is
queued,workingorverifying(the turn is not over); the thread isblockedwith a question open (the edit would drop it); the newest turn did not begin with a message of a person but with a form answer (ui_action, thevymalo.actionactivity: there is no message to replace); the message mentioned agents (vymalo.mentionsin itsSTARTmetadata: an edit carries none); the message was sent while the agent worked (vymalo.delivery,steerorinterrupt: the turn also holds the agent's earlier work, which an edit of that message keeps, so it is not "again"); the caller holds nothread.write(getMe); or the thread is read through a share link (the owner's routes are a 404 to a reader).
The server enforces only the caller's thread.write (403), ownership (404, a share link's reader included), that replace is a message of a person (422) and the tier rules below. Everything else in step 3 is the client's courtesy: a request that ignores it is accepted. The seq of a person's message is the resume point (SSE id:) of the last frame of that message in the stream (agui.md).
tier (ADR 0061, access-tier-v1.md) is the access tier of the message the fork carries, one of plan, edits, auto, bypass, read as forwardedProps["vymalo.tier"] is; it goes with text. An edit that names none is sent under the tier of the message it replaces, lowered to what the caller's roles allow and the agent's live card honours (422 this agent no longer lists access tiers or has no tier at or below ... when it cannot be kept). A first message that names none, from a caller with a role cap, is sent under the highest tier the agent offers that is not above the lower of its default and the cap, as for a new thread.
target names the agent and release the fork talks to (the parent's when absent), validated as for a new thread: an agent the caller's audience leaves out (ADR 0045) is a 400 "unknown agent" in the words, and with the shape, of one that is not listed. id is a UUID the caller chose for the new thread: a repeat of the request with the same id answers the fork it made (200) and writes nothing; the id of another thread is a 409. The caller's own threads only; someone else's is a 404.
Authorizations
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.
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".
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.
Request Body
Responses
The fork this request's id named, made by an earlier request