Skip to main content

DurableChildren

Struct DurableChildren 

Source
pub struct DurableChildren { /* private fields */ }
Expand description

Subagents as child conversations of the session’s durable runtime.

Implementations§

Source§

impl DurableChildren

Source

pub fn new() -> Arc<DurableChildren> ⓘ

Source

pub fn attach(&self, chat: ChatHarness)

Source

pub fn chat(&self) -> Option<ChatHarness>

The runtime the children run in, once it is open.

Source

pub fn attach_session(&self, session: &SharedSession)

The children’s records are values of session, which no worker hands over (an ultron claude server’s, whose subagents are not these children).

Source

pub fn host(self: &Arc<Self>, values: SessionValues) -> SubagentHost

The subagent host of a session: its journal in the session’s values, its children run durably.

Source

pub fn run_lane( &self, stack: &Weak<Stack>, run: LaneRun, ) -> Result<LaneReply, String>

A typed agent’s rlm run, as a child conversation on the lane the task host named.

Source

pub fn fork_point(&self, lane: &str) -> Result<Option<String>, String>

rlm.spawn(fork=True) of lane: where its forked child starts (forkPoint over the lane’s conversation), none while it has no finished conversation. The root’s history is the session transcript (its runtime conversation starts afresh every turn): root:<transcript entry>; another conversation’s is in the runtime: <conversation>:<entry>.

Source

pub fn fork_point_hook(self: &Arc<Self>) -> ForkPointHook

Self::fork_point as the delegation host’s hook.

Source

pub fn set_root(&self, root: Option<String>)

The usage root of the root turn now running (None: the ledger’s default root).

Source

pub fn current_root(&self) -> Option<String>

The usage root of the root turn running now (or last).

Source

pub fn session(&self) -> Option<SharedSession>

The session whose values these children’s records are, once DurableChildren::host gave it.

Source

pub fn kept_child_of_lane(&self, lane: &str) -> Option<String>

The persistent child (keep=True, unfinished) whose cells run on lane (its name), as its REPL id.

Source

pub fn conversation_of_lane(&self, lane: &str) -> Option<ConversationId>

The conversation a child lane runs in, while its task is unfinished.

Source

pub fn usage_root_of_lane(&self, lane: &str, agents: &Agents) -> Option<String>

The usage root of work started on a child lane: its task’s (a typed agent’s reservation, a subagent’s root turn), or the agents host’s for a lane it runs.

Source

pub fn usage_root( &self, conversation: ConversationId, agents: &Agents, ) -> Option<String>

The usage root a model turn of conversation (not the root conversation) is charged to, as usageRootForLane charges every lane’s responses: a typed agent’s lane to its task’s root, a subagent to the root turn that started it, another root conversation to the ledger’s default root.

Source

pub fn lane_of(&self, conversation: ConversationId) -> Option<String>

The lane of a child conversation: the name of the child task that owns it.

Source

pub fn system_of(&self, lane: &str) -> Option<String>

The system prompt a child lane was started with in this process.

Source

pub fn restore( &self, stack: &Stack, unfinished: &[String], ) -> Result<Vec<String>, String>

Reopen the delegation host’s tasks after a restart, reattaching every unfinished child the runtime still holds: its lane gets back its working directory (a worktree child’s), environment and system prompt before the runtime resumes it. Returns the reattached task ids.

A typed agent’s run (agents.*) is not reattached: as in TypeScript (NativeRlmHost reopens its journal with every unfinished task interrupted, and its in-process lanes are gone), the agent task reads interrupted, so the runtime’s child conversation that ran it is aborted rather than left spending tokens for a result nobody reads. So is any other unfinished subagent conversation the journal no longer runs.

Trait Implementations§

Source§

impl Default for DurableChildren

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more