Skip to main content

Agent

Struct Agent 

Source
pub struct Agent {
Show 32 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 mcp_servers: Vec<McpServer>, 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: String

Stable 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: f64

USD spent on messages whose model had a known price.

§cost_breakdown: CostBreakdown

cost_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: u64

Tokens on messages whose model had no known price (so cost_usd is a floor).

§turns: u64§subagent_turns: u64§tool_calls: u64§web_searches: u64

Server-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: u64

Seconds 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§mcp_servers: Vec<McpServer>

The MCP servers this agent uses, one row each, from the process tree and the transcript. See McpServer.

§tree: Option<ProcNode>§attribution: Attribution

How the session was attributed to the process, for debugging attribution.

§shares_process: bool

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. Absent in snapshots written before 0.2.0.

§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.

Trait Implementations§

Source§

impl Clone for Agent

Source§

fn clone(&self) -> Agent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Agent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Agent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Agent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.