Skip to content

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

feat(core): add user agent surface module

Steven Enamakele68f2f8d49b4
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index 3c400bee05..91ba88cb25 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -501,6 +501,14 @@ fn build_registered_controllers() -> Vec<GroupedController> {
DomainGroup::Channels,
crate::channels::controllers::all_channels_registered_controllers(),
);
+ // Messages a gateway relays in from a hosted chat platform
+ // (`channel.relay_inbound`), run on the caller's own channel threads.
+ #[cfg(feature = "channels")]
+ push(
+ &mut controllers,
+ DomainGroup::Channels,
+ crate::channels::providers::relay::all_relay_registered_controllers(),
+ );
// Persistent configuration management
push(
&mut controllers,
diff --git a/crates/openhuman-core/src/user_agents/surface.rs b/crates/openhuman-core/src/user_agents/surface.rs
index 77ecbb7176..581294f49b 100644
--- a/crates/openhuman-core/src/user_agents/surface.rs
+++ b/crates/openhuman-core/src/user_agents/surface.rs
@@ -17,13 +17,16 @@ use crate::core::runtime::{is_saas, CoreContext};
/// isolation lands; a method is listed only once nothing it touches is
/// shared between users.
///
-/// `threads_delete` and `threads_purge` stay off: their cleanup cancels
-/// detached work by bare thread id (and, for purge, process-wide), which would
-/// reach other users' work until it is scoped per agent.
+/// `threads_delete` and `threads_purge` delete only the caller's own threads
+/// (their store is the caller's workspace). Their cleanup of detached
+/// sub-agent work is safe across users once background completions and
+/// running sub-agents are keyed per tenant.
pub const USER_METHODS: &[&str] = &[
// Conversation threads: all state lives under the agent's workspace.
"openhuman.threads_list",
"openhuman.threads_upsert",
+ "openhuman.threads_delete",
+ "openhuman.threads_purge",
"openhuman.threads_create_new",
"openhuman.threads_messages_list",
"openhuman.threads_message_append",
@@ -50,6 +53,9 @@ pub const USER_METHODS: &[&str] = &[
"openhuman.channel_web_queue_status",
"openhuman.channel_web_queue_clear",
"openhuman.channel_web_queue_remove",
+ // Hosted chat platforms: a gateway relays each message in as its user,
+ // onto that user's `channel:` thread; replies reach only their `/events`.
+ "openhuman.channel_relay_inbound",
// Memory: reads and writes confined to the user's own tree
// (`memory::user_scope`). Engine and policy changes, sources, imports and
// backfills stay closed: they reach the host or change where memory lives.