pub struct Agent {Show 31 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 cost_breakdown: CostBreakdown,
pub price_source: Option<PriceSource>,
pub unpriced_tokens: u64,
pub turns: u64,
pub subagent_turns: u64,
pub tool_calls: u64,
pub web_searches: 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,
pub shares_process: bool,
pub parse_warning: Option<String>,
}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.
cost_breakdown: CostBreakdowncost_usd by kind of token, so a figure that differs from another
tool’s can be traced to the one line that differs.
price_source: Option<PriceSource>Where the price of this row’s model came from; None when it has none.
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§web_searches: u64Server-side web searches the model ran, billed per search on top of tokens. Counted for every harness; priced only where the price table has a rate (Anthropic’s, for Claude Code).
spans: Vec<ToolSpan>The most recent spans, oldest first: tool calls, inferences and turns.
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.
True when another row shares this pid and carries its CPU, memory and process counts. One Codex app-server hosts many conversations, so its threads each get a row while the process is only counted once.
parse_warning: Option<String>Set when the transcript parsed but its usage records did not, which means this row’s tokens and cost are not to be believed. Almost always a harness that changed its format under us.