Skip to content

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

feat(session): record driver finish time for post-commit timing

Steven Enamakel916238f0b91e
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rs
index 264d972800..11a151b3a4 100644
--- a/crates/openhuman-core/src/agent/session_host/driver.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver.rs
@@ -396,6 +396,7 @@ impl SessionDriver<OpenHumanRunContext> for OpenHumanSessionDriver {
.map(|usage| usage.charged_amount_usd)
.unwrap_or_default();
observed.duration = Some(started.elapsed());
+ observed.driver_finished_at = Some(std::time::Instant::now());
observed.tool_outcomes = outcome.tool_outcomes.clone();
observed.hit_cap = outcome.hit_cap;
observed.wrap_up_injected = outcome.wrap_up_injected;
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
index 314ce3755b..18c2ff4a8e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
@@ -121,6 +121,10 @@ pub(crate) struct SessionTurnSidecar {
pub hit_cap: bool,
pub wrap_up_injected: bool,
pub resolved_route: Option<ResolvedModelRoute>,
+ /// When the driver handed its candidate to the runtime. `after_commit`
+ /// subtracts it from its own start to log how long the durable commit
+ /// took (`[session-runtime] post-commit`).
+ pub driver_finished_at: Option<std::time::Instant>,
}
/// Immutable inputs to the host's pre-dispatch policy.