REM Vibe Coder docs

Run events and streaming

Every REM Vibe Coder run is a numbered stream of events; the event types, their data, and how to follow a run live over Server-Sent Events with replay.

A run talks to its clients only through events. Each event is stored first (that is the source of truth) and then pushed to anyone following the run, so a client that drops and reconnects misses nothing.

Event shape

{"seq": 12, "run_id": "bda0f6fc-cb14-4e11-b2f2-d0ed13f805dd", "ts": "2026-11-18T10:07:41.204Z", "type": "milestone", "agent": "master", "data": {"text": "Backend API ready: 3 endpoints (list habits, add habit, tick a day)."}}

seq grows by one per event within a run. agent is master, reviewer or worker-<n>.

Event types

type

data

Meaning

status

{run_status}

The run moved: queued, running, waiting, done, failed, stopped

todo

{items: [{id, text, status, system?}]}

The plan card and its progress

milestone

{text}

One short progress line for people

message

{role: "assistant", text}

An answer in the chat

worker

{name, task, status, summary}

A helper agent started or finished a part

tool

{name, args_preview, status, ms, error?}

A tool call (shown in Advanced view)

test

{kind: unit/workflow/smoke/load, passed, total, failed: [{name, expected, actual, error}], screenshots}

A check's result

preview

{status: building/starting/ready/failed, url?}

The preview's state

question

{id, kind: permission/confirm/question/base, text, options?, …}

A card that waits for POST /runs/{id}/answer

answer

{question_id, kind, answer}

The answer given

inbox

{message_id, text, status: queued/picked}

A message sent during the run, and when it was read

workflow

{stage: build_started, features, title} or {stage: verified, app_url}

The plan was approved; the checks passed

deploy

{status: queued/deploying/retrying/live/failed, url?, branch?, pr_url?, error?}

Deploy progress in REM CloudHub

ticket

{status, key, url, kind: task/subtask}

The build's ticket, when your organisation uses Jira

usage

{model, input, output, cache_read, cost_usd}

One model call

error

{code, text, kind: agent/code/infra/user}

Something failed; text is written for people

Secrets are removed from every event before it is stored.

Read stored events

curl -s "$VC/runs/$RUN/events?after=0" $AUTH

Use the highest seq you have as the next after.

Follow a run live (SSE)

EventSource cannot send headers, so ask for a ticket first and open the URL it gives within 60 seconds:

const base = "https://remvibecoder.com/api/v1";
const csrf = document.cookie.match(/vcn_csrftoken=([^;]+)/)[1];
const t = await (await fetch(`${base}/runs/${runId}/stream-ticket`, {
  method: "POST", credentials: "include", headers: { "X-CSRFToken": csrf },
})).json();
const es = new EventSource(t.url);           // already carries ?ticket=…
es.onmessage = (e) => {
  const ev = JSON.parse(e.data);             // {seq, run_id, ts, type, agent, data}
  console.log(ev.seq, ev.type, ev.data);
};

Each SSE frame is id: <seq> plus data: <the event as JSON>; the event's type is inside the JSON (there are no named SSE events), and the id lets the browser send Last-Event-ID when it reconnects.

From a script with the session cookie you can skip the ticket:

curl -N "$VC/runs/$RUN/stream?after=0" $AUTH -H "Accept: text/event-stream"
  • The stream first replays every event after after (or after the Last-Event-ID header), then streams live, and ends when the run ends.

  • A heartbeat comment comes every 15 seconds; a stream is closed after 15 minutes. Reconnect with a new ticket and after = your last seq.

  • The number of open streams per person is limited; above it you get 429 too_many_streams.

A minimal client loop

  1. POST /chats with prompt → run_id.

  2. Follow /runs/{run_id}/stream.

  3. On question, show it and send POST /runs/{run_id}/answer.

  4. On status waiting with a todo in Plan mode, POST /runs/{run_id}/approve.

  5. On deploy live, the url is the app's permanent link.

  6. On status done / failed / stopped, the run is over.

Download: PDF · Word · Markdown

Run events and streaming | REM Vibe Coder · REM Vibe Coder