Skip to content

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

chore: files changed crates/openhuman-core/src/profiles/host.rs,crates/openhuman-core/src/profiles/m

Steven Enamakel200c509e703c
diff --git a/crates/openhuman-core/src/profiles/host.rs b/crates/openhuman-core/src/profiles/host.rs
index 1e274536dd..5694d9a9ad 100644
--- a/crates/openhuman-core/src/profiles/host.rs
+++ b/crates/openhuman-core/src/profiles/host.rs
@@ -15,7 +15,10 @@
//!
//! Each open profile carries its own [`CoreContext`], derived from the operator
//! context with the profile's forced config, its own security policy, and
-//! `profile` and `session_agent` set to its id. Running work under that
+//! `profile` set to its id. It names no `session_agent`: the profile's
+//! default agent runs as the desktop's default orchestrator does, at its
+//! workspace root, and every per-tenant table keys on the profile
+//! (`core::runtime::current_tenant`). Running work under that
//! context is what makes the session store, the config loader and the
//! per-thread tables resolve that user's state.
diff --git a/crates/openhuman-core/src/profiles/mod.rs b/crates/openhuman-core/src/profiles/mod.rs
index bfe9a1f032..3aeb53272d 100644
--- a/crates/openhuman-core/src/profiles/mod.rs
+++ b/crates/openhuman-core/src/profiles/mod.rs
@@ -12,8 +12,9 @@
//! and inspects them through the `profiles.*` controllers ([`schemas`]).
//!
//! The isolation boundary is the profile's own [`CoreContext`]: its config,
-//! workspace, `profile` (the tenant key) and `session_agent` (both set to the
-//! profile id). Work for one user runs under that context, which is what the
+//! workspace and `profile` (the tenant key, set to the profile id); its
+//! default agent runs with no `session_agent`, as on the desktop. Work for
+//! one user runs under that context, which is what the
//! config loader, the session store and the per-thread caches key on.
//!
//! One process hosts a profile at a time: opening one takes its lease
diff --git a/crates/openhuman-core/src/skills/ops_discover/api.rs b/crates/openhuman-core/src/skills/ops_discover/api.rs
index 8a7cc4002c..2a7bba4557 100644
--- a/crates/openhuman-core/src/skills/ops_discover/api.rs
+++ b/crates/openhuman-core/src/skills/ops_discover/api.rs
@@ -11,7 +11,14 @@ use crate::skills::ops_types::{Workflow, TRUST_MARKER};
use super::scan::{discover_filtered, ALL_ROOT_KINDS, WORKFLOW_ROOT_KINDS};
-type MetadataCacheKey = (PathBuf, Option<PathBuf>, bool, Option<String>);
+/// Workspace, home, trust, and the tenant whose agent roots were scanned
+/// (`None`: a SaaS task with no scope, which scans none).
+type MetadataCacheKey = (
+ PathBuf,
+ Option<PathBuf>,
+ bool,
+ Option<crate::core::runtime::Tenant>,
+);
static METADATA_CACHE: LazyLock<RwLock<HashMap<MetadataCacheKey, Vec<Workflow>>>> =
LazyLock::new(|| RwLock::new(HashMap::new()));
static METADATA_GENERATION: AtomicU64 = AtomicU64::new(0);
@@ -87,7 +94,7 @@ pub fn load_workflow_metadata(workspace_dir: &Path) -> Vec<Workflow> {
workspace_dir.to_path_buf(),
home.clone(),
trusted,
- crate::core::runtime::agent_scope::current_agent_id(),
+ crate::core::runtime::current_tenant().ok(),
);
if let Ok(cache) = METADATA_CACHE.read() {
if let Some(workflows) = cache.get(&key) {