Skip to content

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

docs(cost): clarify turn origin source in usage scope

Steven Enamakel91550dee83a5
diff --git a/crates/openhuman-core/src/platform/cost/scope.rs b/crates/openhuman-core/src/platform/cost/scope.rs
index e5995a864f..e046f3e660 100644
--- a/crates/openhuman-core/src/platform/cost/scope.rs
+++ b/crates/openhuman-core/src/platform/cost/scope.rs
@@ -2,7 +2,7 @@
//!
//! Usage is recorded deep in the agent loop, where no caller passes thread or
//! agent ids down. They are already in scope as task-locals, though: the turn
-//! origin (thread, channel or job), the memory identity (the agent definition
+//! origin (thread, channel or job, bound on the turn's `CoreContext`), the memory identity (the agent definition
//! acting) and the [`CoreContext`] (the embedded or SaaS user agent). The
//! recording site adds what only it knows — the provider, and the sub-agent
//! when a delegated child made the call.
@@ -17,7 +17,7 @@ impl UsageScope {
/// The scope of the calling task, with `provider` and the sub-agent (its
/// definition and task id) supplied by the recording site.
pub fn ambient(provider: Option<&str>, subagent: Option<(&str, &str)>) -> Self {
- let origin = crate::agent::turn_origin::current();
+ let origin = crate::core::runtime::CoreContext::current_turn_origin();
let (thread_id, origin) = describe_origin(origin.as_ref());
let definition = crate::memory::scope::current().and_then(|identity| identity.agent_id);
let session_agent = crate::core::runtime::CoreContext::current()