Request
- The client sends
POSTto the agent endpoint. The body is theRunAgentInputas a single JSON object, UTF-8 encoded, withContent-Type: application/json. - The client sends
Accept: text/event-stream(adding the protobuf media type when it can consume that binding too).
Response
- A run that starts answers
200withContent-Type: text/event-stream. - Each SSE event’s
datapayload is exactly one protocol event as a JSON object — never more than one, never a fragment. Multi-linedata:fields join as SSE specifies. - A producer MUST frame the stream with LF (
\n) line endings. The SSE grammar also admits CR and CRLF, but this binding pins the one form every consumer is known to parse; a consumer MAY additionally accept the full grammar. - A consumer MUST ignore SSE fields other than
data(event:,id:,retry:) and MUST tolerate SSE comment lines (: keep-alive), which producers MAY send at any cadence. - The producer closes the response body after the last run’s terminal event. One POST carries one request; a response MAY nevertheless carry several runs when the producer is replaying a thread’s history ahead of the requested run — no further input travels for those, per the binding contract.
Errors
- Input rejected before the run starts — malformed JSON, failed validation, refused auth — is an HTTP error status with no event stream. The run never started.
- A failure after the stream opens travels in-stream, as
RUN_ERROR. The HTTP status is already sent and cannot change; a consumer MUST NOT infer success from200alone. - A connection that drops without a terminal event is a truncated run.
No resumption
The binding has no stream resumption: SSE’sLast-Event-ID mechanism is not
used, and a broken stream cannot be re-entered. Re-running is a new run with a
new runId, whose input carries whatever the consumer retained.