Skip to content

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

feat(remote_control): add remote control channel host

Steven Enamakel4df36f38e34c
diff --git a/crates/openhuman-core/src/channels/host/remote_control.rs b/crates/openhuman-core/src/channels/host/remote_control.rs
index 3cb652f7ac..91103ecc76 100644
--- a/crates/openhuman-core/src/channels/host/remote_control.rs
+++ b/crates/openhuman-core/src/channels/host/remote_control.rs
@@ -67,6 +67,7 @@ pub(crate) async fn dispatch_callback(
}
Request::InvalidateThread { thread_id } => {
let _removed = crate::web_chat::invalidate_thread_sessions_for_tenant(
+ &DispatchCtx::ambient(),
tenant,
&thread_id,
cancellation,
diff --git a/crates/openhuman-core/src/web_chat/ops/state.rs b/crates/openhuman-core/src/web_chat/ops/state.rs
index 7037eb4bf2..950e59aab2 100644
--- a/crates/openhuman-core/src/web_chat/ops/state.rs
+++ b/crates/openhuman-core/src/web_chat/ops/state.rs
@@ -165,11 +165,12 @@ pub async fn invalidate_thread_sessions(ctx: &DispatchCtx, thread_id: &str) {
/// Call from the captured core context so the original session table is used.
/// Cancellation while waiting for that table never mutates a replacement session.
pub(crate) async fn invalidate_thread_sessions_for_tenant(
+ ctx: &DispatchCtx,
tenant: &crate::core::runtime::Tenant,
thread_id: &str,
cancellation: &tokio_util::sync::CancellationToken,
) -> bool {
- let table = thread_sessions();
+ let table = thread_sessions(ctx);
let mut sessions = tokio::select! {
biased;
_ = cancellation.cancelled() => return false,