pub struct SubagentLineage {
pub child_agent_id: String,
pub parent_session_id: Option<String>,
pub parent_tool_use_id: String,
pub depth: usize,
pub agent_type: Option<String>,
pub task: String,
pub background: bool,
pub spawned_at_ms: i64,
pub model: String,
}Expand description
Typed, lossless NATIVE-WRITE lineage record for a spawned child (§1.13;
§5.2 P5 row 3: “native write side — store already parses CC sidechains +
CX lineage on import”). Field names deliberately mirror the keys the
IMPORT-side loaders already populate on
crate::session::SessionMeta::parent_tool_use_id/
crate::session::SessionMeta::lineage (see Self::to_lineage_map),
so a natively-spawned session and an imported CC/CX one land in the same
shape rather than two parallel formats a translator would need to know
about separately.
Fields§
§child_agent_id: StringThis child’s own agent id (the native analog of CC’s agentId).
parent_session_id: Option<String>The parent session’s store name/id, if the parent is itself a stored session.
parent_tool_use_id: StringThe tool_use_id of the parent’s spawn_subagent call that created
this child — the native analog of CC’s recovered
parent_tool_use_id.
depth: usizeHow deep in the spawn tree this child is (parent’s own depth + 1; a top-level agent is depth 0).
agent_type: Option<String>The named capabilities.subagents.agents.<name> type spawned, if
any (None for an ad-hoc inline system_prompt spawn).
task: StringThe task/prompt text the child was spawned with.
background: boolWhether this child was spawned in background mode.
spawned_at_ms: i64Unix-ms wall-clock time the spawn happened.
model: StringThe model the child ran.
Implementations§
Source§impl SubagentLineage
impl SubagentLineage
Sourcepub fn to_lineage_map(&self) -> BTreeMap<String, String>
pub fn to_lineage_map(&self) -> BTreeMap<String, String>
The crate::session::SessionMeta::lineage map a native-spawned
child’s crate::session::Session carries. parent_thread_id is
the SAME key crate::session::Session::reconstruct_tree’s
Codex-lineage nesting step already reads (see that function’s doc
comment) — reusing it rather than minting a new key means a
native-spawned child nests under its parent via the identical
mechanism an imported Codex thread-tree does.
Trait Implementations§
Source§impl Clone for SubagentLineage
impl Clone for SubagentLineage
Source§fn clone(&self) -> SubagentLineage
fn clone(&self) -> SubagentLineage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more