Skip to content

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

docs(runtime): clarify current_agent_id is not a tenant key

Steven Enamakeldb26d648b819
diff --git a/crates/openhuman-core/src/core/runtime/agent_scope.rs b/crates/openhuman-core/src/core/runtime/agent_scope.rs
index d1aacc7c63..bd4753d171 100644
--- a/crates/openhuman-core/src/core/runtime/agent_scope.rs
+++ b/crates/openhuman-core/src/core/runtime/agent_scope.rs
@@ -178,6 +178,11 @@ pub fn agent_scope_dir(config: &crate::config::Config) -> PathBuf {
}
/// The agent id of the ambient context, when it was derived for one.
+///
+/// Genuinely per-agent only: a SaaS profile's default agent has none, so this
+/// is never a tenant key. Tables and stores that must keep tenants apart key
+/// on [`current_tenant`](super::current_tenant) instead; the remaining callers
+/// only log it.
pub fn current_agent_id() -> Option<String> {
CoreContext::current().and_then(|ctx| ctx.session_agent().map(str::to_owned))
}