Skip to main content

Module core

Module core 

Source
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 main ends 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§

Core
OpenOptions

Enums§

Input
What reaches the actor.
Op
The operations a client sends (the commands of rpc-native.ts the 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.ts enqueue).
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 (what ultron --claude sets for the session workers it starts): the root lane runs on Claude Code.
SESSION_CLOSED
The error of a call to a Core whose thread has stopped.

Functions§

call
Run op on the actor and wait for its answer.
claude_root_requested
worker-root.ts claudeRootRequested: ROOT_ENV is claude.
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 (an ai::Usage as JSON) as a usage row of its own, outside any turn, with details saying what spent it (details.source: session-naming, judge).
spawn
Start an actor for options on its own thread; returns its input, or the open error.
user_message
A user message with text and images, as the transcript stores it.

Type Aliases§

EventSink
Where lane-watch events go.
OpResult
What an operation answers: data for the response (None: no data), or the error text.
Reply
Where an operation’s answer goes (called once, possibly later, from the actor’s thread).