pub struct Agent {Show 26 fields
pub id: String,
pub name: String,
pub harness: Harness,
pub state: AgentState,
pub activity: Activity,
pub pid: Option<u32>,
pub session_id: Option<String>,
pub session_path: Option<PathBuf>,
pub cwd: Option<PathBuf>,
pub model: Option<String>,
pub harness_version: Option<String>,
pub usage: TokenUsage,
pub cost_usd: f64,
pub unpriced_tokens: u64,
pub turns: u64,
pub subagent_turns: u64,
pub tool_calls: u64,
pub spans: Vec<ToolSpan>,
pub age_secs: u64,
pub idle_secs: Option<u64>,
pub cpu_percent: f32,
pub rss_bytes: u64,
pub process_count: usize,
pub mcp_count: usize,
pub tree: Option<ProcNode>,
pub attribution: Attribution,
}Expand description
A single row in the agent table.
Fields§
§id: StringStable identity across refreshes: pid:<n> for live agents, session:<id> for stopped ones.
name: String§harness: Harness§state: AgentState§activity: Activity§pid: Option<u32>§session_id: Option<String>§session_path: Option<PathBuf>§cwd: Option<PathBuf>§model: Option<String>§harness_version: Option<String>§usage: TokenUsage§cost_usd: f64USD spent on messages whose model had a known price.
unpriced_tokens: u64Tokens on messages whose model had no known price (so cost_usd is a floor).
turns: u64§subagent_turns: u64§tool_calls: u64§spans: Vec<ToolSpan>The most recent tool calls as spans, oldest first. Bounded; see
harness::MAX_SPANS.
age_secs: u64Seconds since the process started (live) or since the last transcript write (stopped).
idle_secs: Option<u64>Seconds since the transcript was last written.
cpu_percent: f32§rss_bytes: u64§process_count: usize§mcp_count: usize§tree: Option<ProcNode>§attribution: AttributionHow the session was attributed to the process, for debugging attribution.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Agent
impl<'de> Deserialize<'de> for Agent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more