Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Events

A process’s events are the story of its sessions (ADR 5.1). The same events go everywhere: a started bridge’s stdin, the socket’s subscribe, event watch --json, event log --json (read back from the transcript), session new --foreground --json, event notify’s stdin, and the transcript’s records. Each is one JSON object on one line; the examples here show it across lines.

Every name and fixed value brnr makes is snake_case, the subject first (ADR 5.9). ACP’s names and values keep ACP’s spelling (sessionId, end_turn), and an acp record’s dir names the two ends (editor->agent). Who acted is by: editor, agent or control (brnr’s commands, bridges and timers). Beside it, peer is the connection that asked, where brnr knows one (socket#7, a bridge’s name), and reason is why, a word.

Every event has these fields:

FieldTypeMeaning
eventstringIts name: one of the sections below.
sessionstring or null, optionalThe session it is of. Null on an acp message of no session, and on an elicitation_request, elicitation_resolved or elicitation_completed outside any session. Not there on the process’s own events (line_too_long, line_too_deep, peer_cut_off, process_exited), on events_missed, and on a records_skipped in the host log.
tsstringWhen it happened.
host_idstring or nullThe process’s run, <started>-<pid>. Null on the session_deleted that session delete records, which no process does.
pidnumber or nullThe process. Null where host_id is.
seqnumber, optionalIts position: one more than the last event’s or ACP message’s of the process, live and in the transcript. Not there on: the session_deleted that session delete records; the first acp message of a session in its raw ACP file, the copy of the session/new or session/fork that opened it, as the request has its position where it was first recorded (a session/new in the host log, as no session is open yet; a session/fork in the raw ACP file of the session it forks); and the notes, records_skipped and events_missed.
replayedboolean, optionaltrue on an event of a load’s replayed history, which brnr had no transcript of (ADR 5.6). Not there otherwise.

The process’s own events, process_exited, line_too_long and line_too_deep, are in every session’s transcript; peer_cut_off is in the host log.

Covered from 1.0.0: each event’s name and fields, wherever it goes: a bridge’s stdin, --json lines, event notify’s stdin and its variables. Ignore the events and fields you don’t know: a minor release can add them.

Which events: a bridge gets every event but acp, unless its profile’s events chooses; a socket client gets none until it subscribes. event watch, event log and the foreground leave out acp, agent_thought, usage and tool_progress unless --events asks for them (event).

user_message

A message sent to the agent, as its turn takes it.

FieldTypeMeaning
bystringcontrol (brnr’s) or editor (the editor’s own prompt).
messagestring, optionalThe message’s id, m1, as prompt send gave it. Not there for an editor’s own prompt.
promptstringThe turn’s key: its session/prompt request’s JSON-RPC id, as JSON text ("\"brnr-3\""). turn_ended has the same.
textstringIts text; an attachment as [resource_link <uri>], [image].

A replayed user_message (a load’s history) has text and replayed only.

{
  "event": "user_message",
  "session": "sess-1",
  "by": "control",
  "message": "m1",
  "prompt": "\"brnr-3\"",
  "text": "reply hi",
  "ts": "2026-10-23T15:02:31.807712Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 5
}

agent_message

The agent’s message, whole: its chunks put together.

FieldTypeMeaning
textstringThe message.
{
  "event": "agent_message",
  "session": "sess-1",
  "text": "hi",
  "ts": "2026-10-23T15:02:31.808162Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 25
}

agent_thought

The agent’s thought, whole, as agent_message has a message.

FieldTypeMeaning
textstringThe thought.
{
  "event": "agent_thought",
  "session": "sess-1",
  "text": "pondering",
  "ts": "2026-10-23T15:02:31.812650Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 30
}

tool_call

A tool call starting (started), and again ending (status completed or failed).

FieldTypeMeaning
tool_call_idstringThe agent’s id of the call.
titlestringIts title.
kindstringACP’s kind: read, edit, execute, …
statusstringACP’s status: pending, in_progress, completed, failed.
locationslist of objectsThe paths it works on, as the agent gave them.
startedboolean, optionaltrue when it starts. Not there when it ends.
{
  "tool_call_id": "t1",
  "title": "Run the tests",
  "kind": "execute",
  "status": "pending",
  "locations": [],
  "event": "tool_call",
  "session": "sess-1",
  "started": true,
  "ts": "2026-10-23T15:02:31.808098Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 13
}

tool_progress

A running tool call’s status changing in between (in_progress). Progress that doesn’t change it is no event.

FieldTypeMeaning
tool_call_idstringThe call.
titlestringIts title.
kindstringIts kind.
statusstringIts new status.
locationslist of objectsThe paths it works on.
{
  "tool_call_id": "t1",
  "title": "Run the tests",
  "kind": "execute",
  "status": "in_progress",
  "locations": [],
  "event": "tool_progress",
  "session": "sess-1",
  "ts": "2026-10-23T15:02:31.808109Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 15
}

plan

The agent’s plan, whole, each time it changes.

FieldTypeMeaning
entrieslist of objects, ACP’sACP’s plan entries: content, status, priority.
{
  "event": "plan",
  "session": "sess-1",
  "entries": [
    {
      "content": "Run the tests",
      "status": "in_progress",
      "priority": "high"
    },
    {
      "content": "Fix them",
      "status": "pending",
      "priority": "high"
    }
  ],
  "ts": "2026-10-23T15:02:31.808057Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 11
}

usage

The context window and its cost, as the agent reports them.

FieldTypeMeaning
usageobjectWhat the agent reported.
usage.usednumberTokens in the context window.
usage.sizenumberThe context window’s size.
usage.costobject or null, ACP’sThe cost, as the agent gave it ({amount, currency}); null if it gave none.
{
  "event": "usage",
  "session": "sess-1",
  "usage": {
    "used": 12345,
    "size": 200000,
    "cost": {
      "amount": 0.42,
      "currency": "USD"
    }
  },
  "ts": "2026-10-23T15:02:31.808144Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 21
}

session_changed

The session’s title, mode, config options or commands changed.

FieldTypeMeaning
whatstringtitle, mode, config or commands.
valuestring or object, ACP’sA title’s or mode’s new value. For config and commands, a JSON merge patch by option id or command name: each one new or changed, with its value (an option’s currentValue, a command’s object), and null for one gone: {"review": {"name": "review", …}, "compact": null}.
{
  "event": "session_changed",
  "session": "sess-1",
  "what": "config",
  "value": {
    "model": "large"
  },
  "ts": "2026-10-23T15:02:31.816832Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 37
}

permission_request

An approval waiting: the agent’s session/request_permission, held for an answer. Its fields are those of permission show that don’t change.

FieldTypeMeaning
requeststringIts handle, p1.
ownerstringeditor or headless.
titlestring or nullThe tool call’s title, as the agent gave it.
kindstring or nullThe tool call’s kind, as the agent gave it.
tool_callobject, ACP’sThe agent’s tool call, whole.
optionslist of objects, ACP’sThe agent’s options, {optionId, name, kind}.
{
  "event": "permission_request",
  "session": "sess-1",
  "request": "p1",
  "owner": "headless",
  "title": "Edit src/lib.rs",
  "kind": "edit",
  "tool_call": {
    "toolCallId": "perm-1",
    "title": "Edit src/lib.rs",
    "kind": "edit",
    "locations": [
      {
        "path": "src/lib.rs",
        "line": 2
      }
    ],
    "rawInput": {
      "file_path": "src/lib.rs"
    },
    "content": [
      {
        "type": "diff",
        "path": "src/lib.rs",
        "oldText": "one\nold line\nthree\n",
        "newText": "one\nnew line\nthree\n"
      }
    ]
  },
  "options": [
    {
      "optionId": "allow",
      "name": "Allow",
      "kind": "allow_once"
    },
    {
      "optionId": "reject",
      "name": "Reject",
      "kind": "reject_once"
    }
  ],
  "ts": "2026-10-23T15:07:45.069842Z",
  "host_id": "20261023T150744-4466",
  "pid": 4466,
  "seq": 12
}

permission_resolved

An approval answered.

FieldTypeMeaning
requeststringIts handle.
answerstring or nullallowed, rejected or cancelled; null for an editor’s answer with an option of a kind brnr doesn’t know.
option_kindstring or nullThe chosen option’s kind; null when none was chosen.
outcomeobject, ACP’sACP’s outcome, as sent: {"outcome": "selected", "optionId": …} or {"outcome": "cancelled"}.
bystringcontrol, editor, or agent: the agent gave the request up with $/cancel_request.
peerstring or nullThe connection that answered (socket#7, a bridge’s name); null where there is none.
reasonstring or nullWhy brnr answered by itself: timeout (the response timeout) or cancel (its turn was cancelled); null when someone answered.

by: agent is on a request the agent gave up with $/cancel_request (ADR 4.5): headless, brnr answered it cancelled (an elicitation, cancel); an editor answers its own. It is no longer waiting, and an allow, reject or elicitation for it fails.

{
  "event": "permission_resolved",
  "session": "sess-1",
  "request": "p1",
  "answer": "allowed",
  "option_kind": "allow_once",
  "outcome": {
    "outcome": "selected",
    "optionId": "allow"
  },
  "by": "control",
  "peer": "socket#7",
  "reason": null,
  "ts": "2026-10-23T15:07:45.078788Z",
  "host_id": "20261023T150744-4466",
  "pid": 4466,
  "seq": 14
}

elicitation_request

An elicitation waiting: the agent’s elicitation/create, held for an answer. Its fields are those of elicitation show that don’t change.

FieldTypeMeaning
sessionstring or nullIts session; null for one outside any session.
requeststringIts handle, e1.
ownerstringeditor or headless.
modestring or nullform, url, or a mode brnr doesn’t know.
textstring or nullThe agent’s message.
scopestringsession, tool_call or request.
tool_call_idstring or nullThe tool call, for scope tool_call.
scope_request_idstring, number or nullThe request, for scope request.
schemaobject or nullA form’s requestedSchema; null for a URL.
urlstring or nullA URL’s address; null for a form.
elicitation_idstring or nullA URL’s elicitationId; null for a form.
{
  "event": "elicitation_request",
  "session": "sess-1",
  "request": "e1",
  "owner": "headless",
  "mode": "url",
  "text": "Log in to the fake",
  "scope": "session",
  "tool_call_id": null,
  "scope_request_id": null,
  "schema": null,
  "url": "https://login.example/a?b=1",
  "elicitation_id": "el-1",
  "ts": "2026-10-23T15:07:57.998001Z",
  "host_id": "20261023T150757-4466",
  "pid": 4466,
  "seq": 12
}

elicitation_resolved

An elicitation answered.

FieldTypeMeaning
sessionstring or nullIts session; null for one outside any session.
requeststringIts handle.
actionstring or nullACP’s action: accept, decline or cancel, or what an editor sent.
contentobject or null, ACP’sAn accept’s form values; null otherwise.
bystringcontrol, editor or agent, as for permission_resolved.
peerstring or nullThe connection that answered; null where there is none.
reasonstring or nulltimeout or cancel when brnr answered by itself; null otherwise.
{
  "event": "elicitation_resolved",
  "session": "sess-1",
  "request": "e1",
  "action": "accept",
  "content": {
    "color": "green",
    "name": "Ada"
  },
  "by": "control",
  "peer": "socket#7",
  "reason": null,
  "ts": "2026-10-23T15:07:49.039746Z",
  "host_id": "20261023T150748-4466",
  "pid": 4466,
  "seq": 14
}

elicitation_completed

The agent says a URL elicitation’s flow is done (elicitation/complete).

FieldTypeMeaning
sessionstring or nullThe elicitation’s session; null if brnr doesn’t know it.
requeststring or nullIts handle; null if brnr doesn’t know it.
elicitation_idstringThe agent’s elicitationId.
{
  "event": "elicitation_completed",
  "session": "sess-1",
  "request": "e1",
  "elicitation_id": "el-1",
  "ts": "2026-10-23T15:07:58.006073Z",
  "host_id": "20261023T150757-4466",
  "pid": 4466,
  "seq": 16
}

turn_ended

A turn ended: the agent answered its session/prompt.

FieldTypeMeaning
bystringcontrol for a turn brnr started, editor for the editor’s.
promptstringThe turn’s key, as its user_message has it.
messageslist of stringsThe messages it carried: the prompt’s, and those steered into it.
stop_reasonstring or nullACP’s stop reason: end_turn, cancelled, max_tokens, …; null if the turn failed.
errorobject or nullThe turn’s failure: {code, message}, agent_failed with the agent’s JSON-RPC error as rpc_error (errors); null if it didn’t fail.
tokensobject or nullThe counts the agent put in its answer (usage, unstable in ACP); null when the answer has no usage object.
tokens.totalnumber or nulltotalTokens.
tokens.inputnumber or nullinputTokens.
tokens.outputnumber or nulloutputTokens.
tokens.thoughtnumber or nullthoughtTokens.
tokens.cached_readnumber or nullcachedReadTokens.
tokens.cached_writenumber or nullcachedWriteTokens.

Each count is the agent’s number, or null where it gave none that is a count (a JSON integer that fits a u64; not 1e3). brnr adds nothing up and doesn’t say what they cover: whether subagents or earlier model calls are in them is the agent’s to say (ADR 4.4).

{
  "event": "turn_ended",
  "session": "sess-1",
  "by": "control",
  "prompt": "\"brnr-3\"",
  "messages": [
    "m1"
  ],
  "stop_reason": "end_turn",
  "error": null,
  "tokens": {
    "total": 1234,
    "input": 1000,
    "output": 234,
    "thought": null,
    "cached_read": null,
    "cached_write": null
  },
  "ts": "2026-10-23T15:02:31.808172Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 26
}

message_dropped

A message that never went to the agent.

FieldTypeMeaning
messagestringIts id.
textstringIts text.
reasonstringcancel (prompt cancel), queue (queue drop, queue clear), close (its session closed), exit (the agent exited) or steer (the agent refused it as a steer).
{
  "event": "message_dropped",
  "session": "sess-1",
  "message": "m2",
  "text": "later",
  "reason": "cancel",
  "ts": "2026-10-23T15:15:01.068955Z",
  "host_id": "20261023T151500-4466",
  "pid": 4466,
  "seq": 11
}

context_dropped

Context that never joined a prompt.

FieldTypeMeaning
textstringIts text.
reasonstringqueue (queue clear), close or exit.
{
  "event": "context_dropped",
  "session": "sess-1",
  "text": "the API key is in .env.local",
  "reason": "queue",
  "ts": "2026-10-23T15:15:01.074214Z",
  "host_id": "20261023T151500-4466",
  "pid": 4466,
  "seq": 15
}

session_closed

A session closed. What it held is dropped first, each with its event. The last session of a process that stops when idle isn’t closed: the process stops, and process_exited says so in place of this (ADR 3.8).

FieldTypeMeaning
bystringcontrol or editor.
reasonstringBy control: close (session close, --take-over) or idle (stop_when_idle). By editor: close.
{
  "event": "session_closed",
  "session": "sess-1",
  "by": "control",
  "reason": "close",
  "ts": "2026-10-23T15:15:01.084882Z",
  "host_id": "20261023T151500-4466",
  "pid": 4466,
  "seq": 18
}

session_reopened

An editor’s load of a session that the agent answered with success after it answered the session’s close: the session is open again, and the load’s history follows. None if another process took the session meanwhile, which the editor’s process then doesn’t serve (ADR 3.9).

FieldTypeMeaning
bystringeditor.
{
  "event": "session_reopened",
  "session": "sess-1",
  "by": "editor",
  "ts": "2026-10-23T15:20:11.120412Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "seq": 31
}

session_deleted

The agent deleted the session (session/delete). brnr’s transcript stays.

FieldTypeMeaning
bystringcontrol (session delete) or editor.

session delete records it in the session’s transcript with host_id and pid null, and no seq: no process has the session open. An editor’s deletion, through its process, goes into every file of the session.

{
  "event": "session_deleted",
  "session": "sess-1",
  "by": "control",
  "ts": "2026-10-23T15:15:01.648337Z",
  "host_id": null,
  "pid": null
}

history

A load’s replay ended (session/load): the history the agent sent again.

FieldTypeMeaning
updatesnumberHow many updates it replayed.
recordedbooleanWhether the replay was taken into the transcript at all, as events with replayed.
recorded_updatesnumberHow many of the updates are in it: all when recorded, none when not, fewer when the session closed while its load was unanswered, as what came meanwhile had no file to go to.
loadsnumberHow many loads it answers. An editor’s loads of a session that overlap share one replay and one history event, so this can be more than 1, and a recorded history is then in the transcript once for each load.
{
  "event": "history",
  "session": "old-1",
  "updates": 3,
  "recorded": true,
  "recorded_updates": 3,
  "loads": 1,
  "ts": "2026-10-23T15:14:52.389129Z",
  "host_id": "20261023T151452-4466",
  "pid": 4466,
  "seq": 11
}

line_too_long

A line past the limit (32 MiB), not read and not recorded. With an editor it goes on to the other side; headless, it is dropped.

FieldTypeMeaning
fromstringagent or editor.
limitnumberThe limit, in bytes.
relayedbooleanWhether it went on to the other side.
{
  "event": "line_too_long",
  "from": "agent",
  "limit": 33554432,
  "relayed": false,
  "ts": "2026-10-23T15:14:47.066039Z",
  "host_id": "20261023T151446-4466",
  "pid": 4466,
  "seq": 22
}

line_too_deep

A line nested past the depth brnr reads (128 levels; [[1]] is 2), not read and not recorded. With an editor it goes on to the other side; headless, it is dropped. brnr tracks nothing of it: a permission request that deep isn’t listed or answerable from outside.

FieldTypeMeaning
fromstringagent or editor.
max_depthnumberThe depth brnr reads.
relayedbooleanWhether it went on to the other side.
{
  "event": "line_too_deep",
  "from": "agent",
  "max_depth": 128,
  "relayed": false,
  "ts": "2026-10-23T15:14:47.046629Z",
  "host_id": "20261023T151446-4466",
  "pid": 4466,
  "seq": 17
}

peer_cut_off

A peer (a watcher, a bridge) cut off for falling behind (ADR 10.2), told to the other peers.

FieldTypeMeaning
peerstringThe connection cut off (socket#7, a bridge’s name).
last_queued_seqnumberThe last event’s position it was sent.
{
  "event": "peer_cut_off",
  "peer": "socket#7",
  "last_queued_seq": 4120,
  "ts": "2026-10-23T15:21:40.501930Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "seq": 4121
}

process_exited

The agent exited, and the process with it.

FieldTypeMeaning
exit_statusobject or null{"code": n}, or {"signal": n} for one a signal ended; null where it isn’t known.
exit_status.codenumber, optionalThe exit code. Not there when a signal ended it.
exit_status.signalnumber, optionalThe signal that ended it. Not there otherwise.
errorobject, optionalWhy, {code, message}, when brnr itself failed (process_panicked). Not there otherwise.
{
  "event": "process_exited",
  "exit_status": {
    "code": 0
  },
  "ts": "2026-10-23T15:14:53.637024Z",
  "host_id": "20261023T151452-4466",
  "pid": 4466,
  "seq": 13
}

acp

An ACP message, with its direction: every message between the agent and the editor or brnr. Only to a peer that asks for it by name, and in event log read from the raw ACP file; never in the events file.

FieldTypeMeaning
dirstringeditor->agent, agent->editor, control->agent (brnr’s: a prompt, a cancel, an answer as the client), control->editor (a message sent through brnr, shown to the editor), agent->control (an answer for brnr), or agent_stderr.
sessionstring or nullThe session it is of; null for one of none.
msgobject or string, ACP’sThe message, as brnr read it; a line that isn’t JSON as a string.
{
  "event": "acp",
  "dir": "control->agent",
  "session": "sess-1",
  "msg": {
    "jsonrpc": "2.0",
    "id": "brnr-3",
    "method": "session/prompt",
    "params": {
      "sessionId": "sess-1",
      "prompt": [
        {
          "type": "text",
          "text": "reply hi"
        }
      ]
    }
  },
  "ts": "2026-10-23T15:02:31.807726Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 6
}

Notes

Notes are what brnr adds to a stream of events. No process sends one: subscribe and a bridge’s events refuse their names (event_unknown). --events takes them, and shows them whatever it chose.

records_skipped

A gap in a transcript: records brnr couldn’t write (a disk too slow or full), in event log.

FieldTypeMeaning
countnumberEvent records skipped.
acp_countnumberRaw ACP records skipped.
sincestringWhen the first was made.
untilstringWhen the last was made.
first_seqnumber, optionalThe first’s position. Not there when none had one.
last_seqnumber, optionalThe last’s position. Not there when none had one.
errorobject, optionalWhy, {code, message}. Not there when brnr knows none.

It has ts, host_id and pid, and session in a session’s file.

{
  "event": "records_skipped",
  "count": 120,
  "acp_count": 4,
  "since": "2026-10-23T15:30:00.104512Z",
  "until": "2026-10-23T15:30:02.881002Z",
  "first_seq": 981,
  "last_seq": 1104,
  "ts": "2026-10-23T15:30:02.881140Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "session": "sess-1"
}

events_missed

What a command cut off for falling behind couldn’t catch up on from the transcript (ADR 10.2). event watch prints it on stdout as its last event; event notify, event wait and the --waits say it on stderr. They exit 3.

FieldTypeMeaning
peerstringThe command’s connection, as subscribe named it.
after_seqnumberThe last event it got.
until_seqnumber or nullWhere it subscribed again, or, if that failed each time, where the process said it cut the command off. Null only for a process gone, or one that said no position, as error then says.
errorobjectWhy it couldn’t catch up, {code, message}.

It has ts, host_id and pid.

{
  "event": "events_missed",
  "ts": "2026-10-23T15:31:09.004211Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "peer": "socket#12",
  "after_seq": 4120,
  "until_seq": 4502,
  "error": {
    "code": "transcript_not_kept",
    "message": "the process keeps no transcript to read (log = \"off\")"
  }
}