Session status
Status is computed per session; sibling sessions of the same agent never leak into it.
Sending events
POST /v1/sessions with Idempotency-Key is replay-safe: the same key returns the same session.
Events you receive
Streaming and resuming
GET /v1/sessions/{id}/events/stream is a server-sent event stream.
- Without
Last-Event-ID, the stream delivers events emitted after it opens. Open it before you send, or rely on BMA’s rule that a stream opened during a running turn starts at that turn’s input. - Every durable event carries
bma_sequence. Store the last value you processed and reconnect withLast-Event-ID: <bma_sequence>. A browserEventSourcesends back the opaque SSEidautomatically; BMA accepts both.Last-Event-ID: 0replays the whole session. A malformed or unknown value is400. - History:
GET /v1/sessions/{id}/eventspages withlimit/pageand filters bytypes[]. If the last page ends with an open permission request, BMA appends the samerequires_actionidle event the stream announced, so a restarted worker knows it must answer.