Expand description
The session actor: one session (format-4 journal), its lane (the rlm kernel over the composition root’s host
stack) and the run in progress, owned by one thread. Every client operation is an Op answered through its
reply; the run’s progress is reported as TypeScript lane-watch events (run_start, message_*, tool_*,
entry_added, queue_update, compaction_*, config_update, run_end) through the event sink, which the
session worker folds into its ultron.transcript state.
The run executes the agent loop on a thread of its own; its events come back to the actor as Input::Agent,
so operations keep being answered while a run streams. Runs and compactions are journaled as the harness journals
them (crate::journal, crate::compaction_op); reads see the session as Pi entries ([crate::pi_view]).
Modules§
- durable_
turns - The session actor’s side of durable turns (crate::turns): starting a turn in the durable runtime, answering a generation’s start with the request the TypeScript agent loop would send, noticing the end of a turn, aborting one, and resuming one a dead worker left (projecting onto the transcript what the runtime committed and the transcript had not, then letting the runtime continue).
- event_
lanes - The session’s lanes as the completion-event dispatcher sees them (crate::async_events): the root lane is the session actor’s (its runs, its queue, its transcript), asked through the actor’s input; another lane is a child conversation of the durable runtime (a subagent’s), steered through its inbox while it runs.
- turn_
guard - What the host checks when a root run on
mainends normally with nothing waiting, after the keep-going and persona nudges (core::persona_nudge) had their turn. The first that applies continues the turn with a nudge message (a displayed custom message, journaled like any run’s prompt):
Structs§
Enums§
- Input
- What reaches the actor.
- Op
- The operations a client sends (the commands of
rpc-native.tsthe session worker serves, and the agent controller’s members). Session selection (new, switch, fork, clone) is the server’s: clients re-attach.
Constants§
- AUTO_
NAME_ ENV - AUTO_
REFINE_ ENV - EMPTY_
QUEUED InvalidMessage(reason: "empty") of a queued message without text or image (lane.tsenqueue).- RECOVERY_
RESUME_ ENV - RESTORE_
IN_ SANDBOX - A restore inside the shell sandbox.
- RESTORE_
WHILE_ STREAMING - A restore while a run streams.
- ROOT_
ENV ULTRON_ROOT=claude(whatultron --claudesets for the session workers it starts): the root lane runs on Claude Code.- SESSION_
CLOSED - The error of a call to a
Corewhose thread has stopped.
Functions§
- call
- Run
opon the actor and wait for its answer. - claude_
root_ requested - worker-root.ts
claudeRootRequested:ROOT_ENVisclaude. - lane_
config - The lane configuration a session runs with: the session’s own for a resumed session without model flags, else the flags’ (written for a new session). Returns the stored configuration and the model it names.
- record_
naming - Apply a naming response: its usage as a row of its own, and its title while the name is still automatic.
- record_
usage_ row - Commit
usage(anai::Usageas JSON) as a usage row of its own, outside any turn, withdetailssaying what spent it (details.source:session-naming,judge). - spawn
- Start an actor for
optionson its own thread; returns its input, or the open error. - user_
message - A user message with text and images, as the transcript stores it.