Expand description
The composition root of a session’s host stack. A cell’s host request passes, outermost first:
kernel_apis::KernelApis: the kernel-API modules (skills.*with code skills,memory.*,hints.*,images.*,diagram.*, and the local services ofservices:refinements.*,experiments.*,gates.*), matched by prefix;inference::Inference:rlm.infer,rlm.load,rlm.frames;- [
Router]: subagents (rlm.spawn,rlm.collect, … served bydelegation::host::Delegationfor the calling lane, in host collect mode: a cell never waits); the lane API (rlm.lanes,rlm.lane.*,rlm.cells,rlm.cell.cancel,rlm.recovery) is answered by the session’s REPL lanes (lanes::Lanes) first; host::Host, sandboxed (host::Host::sandboxedwith thesandbox.*settings) over the session’s file hooks (Loki): shell, jobs and the before-write check.
Each lane’s kernel runs inside the session’s shell sandbox (KernelOptions::sandbox), with ULTRON_FILE_HOOKS=1
(its writes ask the host first), a per-session spill dir, a signed snapshot under the profile’s rlm-snapshots/<session>/ with the profile
snapshot key, and the continuity policy (checkpoint after each cell, restore on restart). Subagent and detached
cell completions continue the run between turns (RuntimeEvents). The model sees one tool, rlm.
Structs§
- Agent
Stores - Where the typed-agent host keeps its records, and how its
rlmlanes run. - Child
Reader - Who a subagent’s prompt is for: an in-memory child (without the durable runtime’s APIs) or not, and how much its guide says about memory (crate::memory_guidance, by its model’s tier).
- Child
Setup - What a subagent runs with: its model, its system prompt (naming its working directory) and thinking level.
- Config
- What every lane of this process shares: settings, locations, guards and the snapshot key. Owned values only, so subagent lanes can be built on their own threads.
- Memory
Choice - The memory backend a process uses (
memory_backend). - Runtime
- The process-wide composition: configuration and injected services.
- Runtime
Events - Completions of work a run started that outlives its cell: typed tasks nobody awaited (
task_done), subagents (child_done) and detached cells (cell_done), of every lane. Each completion continues its lane’s run as a<runtime_event>message.ULTRON_ASYNC_EVENTS=offturns this off: nothing waits and nothing is announced. - Services
- Collaborators a caller may supply in place of the defaults (tests, embedders).
- Stack
- One session’s host stack: the sandboxed host, the REPL lanes, the subagent host and the kernel-API modules.
- Subagent
Host - How a session’s subagents run, and where their task journal lives.
- System
Prompt - The root system prompt, rendered again only when the settings’
crate::lane::PromptModechanges (engineering mode,alwaysSkills), so the prompt-cache prefix stays stable (session-worker.tscurrentSystemPrompt). A change applies from the next request.
Constants§
- CELL_
CANCELLED_ SHELL - Why a cancelled cell’s shell request failed: Python raises it, so the cell ends at once with its kernel (and the lane’s variables) intact.
- CONTEXT_
REMINDER_ ENV - CONTEXT_
REMINDER_ TOKENS_ ENV - EXTENSIONS_
UNSUPPORTED - What a cell’s
ext.call/ext.list(runtime.py’s Pi extension functions) is answered. - GUIDE_
ENV - LOKI_
ENV - LOKI_
TIMEOUT_ MS_ ENV - MASK_
SECRETS_ ENV - READ_
HANDLE_ BYTES_ ENV - TURN_
GUARDS_ ENV ULTRON_TURN_GUARDS:offturns the turn guards off.
Functions§
- child_
setup - A subagent’s lane: in its worktree when it has one (its shell, kernel and prompt name that working directory, as
session-worker.tsrewrites it), on the session’s model unless the spawn named one. - hinted_
lanes - A typed agent’s
rlmlane runner whose every run’s end is reported toendedwith its lane: the session’s cell hints start that lane’s stuck-loop detection over (cellHints.runEnded(lane)on every lane’srun_end), so a retained instance’s next run does not inherit the last one’s failure streak. - hints
- Whether
ULTRON_HINTS=onends cell results with situational[hint:<tag>]lines (kernel_apis::cell_hints), which the runtime guide then explains. - mcp_
runtime_ guide - The runtime guide’s view of the
mcpgateway: the tool and its servers whenmcp.jsonnames any. - memory_
backend - The memory backend of a process with
varand the settings ofmanager(profileagent_dir):memorantado::Endpoint::chooseover the Hindsight server resolved the same way, probing memorantado over HTTP. Sessions andultron memoryboth choose through it. - only_
rlm - Whether a value lists exactly the
rlmtool: the invariant every request body keeps. - session_
environment - The environment a session’s kernels and commands start from (TS: the worker’s
process.env, which kernel.tskernelEnvironmentfilters andgetShellEnvextends): every name this process has plus [SESSION_ENV_NAMES], each with the value the session’svargives it (dropped when it gives none). Values come only from the session’s environment, never from this process’s: a session whose PATH differs runs its tools from its own PATH. - session_
mask - The session’s masking of text that reaches the model: values MCP servers resolved (
registerSecretValues) and the shipped rules, unlessULTRON_MASK_SECRETSturns it off. - store_
roots - The session stores
sessions.*,/continueand the dream’s quiet check search: the session root itself, then the profile’s native and Pi-format stores, then every project instance’s own store (<home>/.ultron/projects/*/sessions, where a session started in a project is kept), in name order. - task_
event_ summary - The summary of a task’s end event (
taskEventof session-worker.ts): the task’s definition, then its verdict tag ([passed, verified],[unverified], …) when it has one, then its reply (a non-string value as JSON) or, unless it succeeded, its error. - ts_
guide - Whether
ULTRON_GUIDE=tsasks for the TypeScript guide and output (the TS-recorded replays use it): no Rust-only APIs, wording or cell-result additions. - turn_
guards - Whether the turn guards are on: a lane going in circles is told so and its seventh identical cell in a row is
refused (kernel_apis::cell_hints), and the root’s turn is continued after an empty reply or with what its
subagents left undone (crate::core
turn_guard). Off underULTRON_TURN_GUARDS=offand the TypeScript guide. - workspace_
snapshotter - After-cell checks picture the directory between cells (workspace-snapshot.ts).
Type Aliases§
- Agent
Lanes - Builds a typed-agent lane runner from the stack being built (it may hold the stack weakly).
- McpListener
- Told the session’s MCP gateway when its stack opens.