pub struct DurableChildren { /* private fields */ }Expand description
Subagents as child conversations of the session’s durable runtime.
Implementations§
Source§impl DurableChildren
impl DurableChildren
pub fn new() -> Arc<DurableChildren> ⓘ
pub fn attach(&self, chat: ChatHarness)
Sourcepub fn chat(&self) -> Option<ChatHarness>
pub fn chat(&self) -> Option<ChatHarness>
The runtime the children run in, once it is open.
Sourcepub fn attach_session(&self, session: &SharedSession)
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).
Sourcepub fn host(self: &Arc<Self>, values: SessionValues) -> SubagentHost
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.
Sourcepub fn run_lane(
&self,
stack: &Weak<Stack>,
run: LaneRun,
) -> Result<LaneReply, String>
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.
Sourcepub fn fork_point(&self, lane: &str) -> Result<Option<String>, String>
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>.
Sourcepub fn fork_point_hook(self: &Arc<Self>) -> ForkPointHook
pub fn fork_point_hook(self: &Arc<Self>) -> ForkPointHook
Self::fork_point as the delegation host’s hook.
Sourcepub fn set_root(&self, root: Option<String>)
pub fn set_root(&self, root: Option<String>)
The usage root of the root turn now running (None: the ledger’s default root).
Sourcepub fn current_root(&self) -> Option<String>
pub fn current_root(&self) -> Option<String>
The usage root of the root turn running now (or last).
Sourcepub fn session(&self) -> Option<SharedSession>
pub fn session(&self) -> Option<SharedSession>
The session whose values these children’s records are, once DurableChildren::host gave it.
Sourcepub fn kept_child_of_lane(&self, lane: &str) -> Option<String>
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.
Sourcepub fn conversation_of_lane(&self, lane: &str) -> Option<ConversationId>
pub fn conversation_of_lane(&self, lane: &str) -> Option<ConversationId>
The conversation a child lane runs in, while its task is unfinished.
Sourcepub fn usage_root_of_lane(&self, lane: &str, agents: &Agents) -> Option<String>
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.
Sourcepub fn usage_root(
&self,
conversation: ConversationId,
agents: &Agents,
) -> Option<String>
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.
Sourcepub fn lane_of(&self, conversation: ConversationId) -> Option<String>
pub fn lane_of(&self, conversation: ConversationId) -> Option<String>
The lane of a child conversation: the name of the child task that owns it.
Sourcepub fn system_of(&self, lane: &str) -> Option<String>
pub fn system_of(&self, lane: &str) -> Option<String>
The system prompt a child lane was started with in this process.
Sourcepub fn restore(
&self,
stack: &Stack,
unfinished: &[String],
) -> Result<Vec<String>, String>
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.