Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(progress_tracing): update tests for optional cost and cost tally

Steven Enamakel72e738d06237
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
index 07384c9e3c..ab42f3153d 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
@@ -258,7 +258,7 @@ fn custom_model_generation_is_stamped_custom_provenance() {
cached_input_tokens: 0,
cache_creation_tokens: 0,
reasoning_tokens: 0,
- cost_usd: 0.0001,
+ cost_usd: Some(0.0001),
};
let mut c = collect(&[(AgentProgress::TurnStarted, 0), (event, 10)]);
c.finish(20);
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
index 1e2b669915..cd4b25464a 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
@@ -105,7 +105,7 @@ fn model_call(model: &str, reasoning: u64, cache_write: u64) -> AgentProgress {
cached_input_tokens: 300,
cache_creation_tokens: cache_write,
reasoning_tokens: reasoning,
- cost_usd: 0.0042,
+ cost_usd: Some(0.0042),
}
}
@@ -139,7 +139,7 @@ fn model_call_with_content(subagent_task_id: Option<&str>) -> AgentProgress {
cached_input_tokens: 0,
cache_creation_tokens: 0,
reasoning_tokens: 0,
- cost_usd: 0.001,
+ cost_usd: Some(0.001),
}
}
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
index fb3318acbb..b85faccd5b 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
@@ -40,7 +40,7 @@ fn completed(iteration: u32) -> AgentProgress {
cached_input_tokens: 90,
cache_creation_tokens: 0,
reasoning_tokens: 5,
- cost_usd: 0.001,
+ cost_usd: Some(0.001),
}
}
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
index b594ebf183..cbad87c2c8 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
@@ -20,7 +20,7 @@ fn classified_halt_returns_partial_work_without_provider_usage() {
input_tokens: 100,
output_tokens: 20,
cached_input_tokens: 0,
- charged_amount_usd: 0.0,
+ cost: crate::agent::cost::CostTally::default(),
early_exit_tool: None,
hit_cap: false,
wrap_up_injected: false,
@@ -72,7 +72,7 @@ async fn run(candidates: Vec<String>, verdicts: Vec<Option<CloseViolation>>) ->
async move { (violation, None) }
};
- let (output, usage) = close_with_one_repair(instruction.clone(), None, ask, verify, || {
+ let (output, usage) = close_with_one_repair("test-model", instruction.clone(), None, ask, verify, || {
FALLBACK.to_string()
})
.await;
@@ -197,7 +197,7 @@ fn blank_outcome(truncated: bool) -> TinyagentsTurnOutcome {
input_tokens: 0,
output_tokens: 0,
cached_input_tokens: 0,
- charged_amount_usd: 0.0,
+ cost: crate::agent::cost::CostTally::default(),
early_exit_tool: None,
hit_cap: false,
wrap_up_injected: false,