Skip to main contentRuntime

Event lifecycle

An RCP event moves through four stages between the moment it happens and the moment you can search or replay it.

1. Emit

A connected client creates an event envelope and POSTs it to the Runtime Gateway's event endpoint with a bearer token scoped to that client's API key. Emission is fire-and-forget — a failed send never blocks your AI tool.

2. Ingest

The gateway validates the envelope, attaches server-side context (workspace, billing attribution) and persists it. For proxied model requests, the gateway itself emits additional events — ModelInvocationStarted, CompletionCompleted, runtime.CostRecorded — around the request it is forwarding.

3. Index

Events are indexed by workspace, session and timestamp so they can be queried instantly — by a dashboard, by Ask Runtime, or by the CLI's live activity stream.

4. Consume

Three surfaces read the same event stream:

  • Activity & Billing — the dashboard renders events as they arrive.
  • Replay— a session's full event list is fetched and rendered as a timeline, in order.
  • Ask Runtime — events are the source data behind answers about cost, authorship and history.

A live subscription is also available — the Runtime CLI's runtime activity --liveopens a WebSocket to stream events for a workspace in real time, which is what powers the “tailing” state you see while a session is still running.