Expand description
Saved Agent conversations: one append-only JSON Lines file per review session, which
session show reads and session send continues.
$STATE/agent-sessions/ (owner-only) holds <sessionId>.jsonl, an owner-only file of
one JSON event per line, and <sessionId>.lock, which serializes the sends to it:
review, first: the session, Run, request and eval ids, the producer and state id, the backend, model, reasoning, provider parameters, budgets and tool definitions;message: one rigMessageexactly as the provider received or sent it, with theturn(the provider request) that carried it. The system prompt and instructions come first, then each answer with its reasoning (encrypted reasoning items and thinking signatures included), tool calls and their results. A message of tool results hasisError, whether each result failed, in order. The repair prompt hasrepair, and the answer it replaced is the message before it;attempt: one provider attempt of aturn, itsusagecounters and any error;end: the review’sresult, or itserrorCodeanderror;sendandansweraround each follow-up, whose events carry itssendnumber.
Every event has its time in at. Writing never fails a review: an error is reported on
stderr and the review goes on without its conversation.
Modules§
- document
- Pure session layout and scrolling, shared by terminal and future graphical viewers. Rows are indexed by logical UTF-8 offsets, not terminal-sized global scroll coordinates.
- live
- Incremental, state-scoped session reading. Call bounded
stepjobs off the UI thread. Only byte offsets and row counts survive cache eviction; older history is paged in on demand. - transcript
- Semantic, minimal session presentation. Stored events remain lossless; this view keeps only prose and bounded activity headers, never tool output, arguments, reasoning or media payloads.
Structs§
- Budgets
- Collection
- What one collection found and did.
- Conversation
- A saved conversation, read whole.
- Delivery
- Event
- Header
- Message
Event - Recorder
- Appends one session’s events. It writes nothing when saving is off, and after a failed write it reports the error once and writes nothing more.
- Saving
- Where new conversations are saved, and as which producer and state;
Nonewhen saving is off (agentSessions.enabled: falseinlimits.json). - Send
- Session
Ref - Where an Agent review’s conversation lives: the producing
user@host, the state (by its stable id), and the Run, request and session ids. Its text form isuser@host/<state>/<runId>/<requestId>/<sessionId>. - Summary
- A saved conversation’s backend, time span, turns, tokens and tool calls.
- Usage
- The session store’s size.
Enums§
Constants§
- DIRECTORY
- The session store below the state directory.
Functions§
- collect
- Collect the store under
bounds(see the module). The sessions that are listed first and then found RUNNING were saved after their request turned RUNNING, so a review that starts during a collection is either seen as running or not listed at all. - directory
- The session store of a state.
- lock
- Hold
<sessionId>.lockuntil the returned file drops: sends to one session take turns. - path
- The conversation file of a session id.
- tokens_
text - Token counters as text, in a fixed order with readable names;
Nonewithout any. - usage
- How many conversations the store holds and their bytes.