pub struct HarnessUsage {
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_read_input_tokens: u64,
pub cache_creation_input_tokens: u64,
pub compaction_input_tokens: u64,
pub compaction_output_tokens: u64,
}Expand description
Token / cache usage reported by the model client at the end of a turn.
Kept independent of any wire format (no grpc::* import) so the harness
crate stays a pure domain library. The core::native_adapter layer
converts this to the proto SessionUsage shape on the way out.
Fields§
§input_tokens: u64Total input tokens spent this turn (main steps + compaction
summarize calls combined). Same field the wire SessionUsage
surfaces today — keeps HR’s existing dashboards correct.
output_tokens: u64Total output tokens this turn (main + compaction).
cache_read_input_tokens: u64Cache-read tokens (Anthropic). 0 = unknown / not applicable.
cache_creation_input_tokens: u64Cache-create tokens (Anthropic). 0 = unknown / not applicable.
compaction_input_tokens: u64Subset of input_tokens spent specifically on compaction
summarize calls. 0 = no compaction ran this turn (or it ran
but the provider didn’t report usage). Surfaced in
tracing for now; not yet wired to proto SessionUsage —
when HR wants the breakdown on the wire, add fields to the
proto + map in native_adapter::harness_usage_to_proto.
compaction_output_tokens: u64Subset of output_tokens spent on compaction.
Trait Implementations§
Source§impl Clone for HarnessUsage
impl Clone for HarnessUsage
Source§fn clone(&self) -> HarnessUsage
fn clone(&self) -> HarnessUsage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more