Skip to content

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

chore(composio): remove unused bus subscriber modules

Steven Enamakelaf3d117dbe33
diff --git a/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs b/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs
index 847c11483a..bb2096c968 100644
--- a/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs
+++ b/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs
@@ -51,7 +51,16 @@ impl EventHandler<DomainEvent> for ComposioConfigChangedSubscriber {
}
async fn handle(&self, event: &DomainEvent) {
- let DomainEvent::ComposioConfigChanged { mode, api_key_set } = event else {
+ let DomainEvent::ComposioConfigChanged {
+ mode,
+ api_key_set,
+ tenant,
+ } = event
+ else {
+ return;
+ };
+ let Some(ctx) = DispatchCtx::for_event(tenant.as_ref()) else {
+ tracing::debug!("[composio-cache] config change has no tenant; eager warm skipped");
return;
};
@@ -63,7 +72,7 @@ impl EventHandler<DomainEvent> for ComposioConfigChangedSubscriber {
ops::invalidate_connected_integrations_cache();
tokio::spawn(async move {
- let config = match DispatchCtx::ambient().load_config().await {
+ let config = match ctx.load_config().await {
Ok(config) => config,
Err(error) => {
tracing::debug!(
diff --git a/crates/openhuman-core/src/integrations/composio/bus/connection_created_subscriber.rs b/crates/openhuman-core/src/integrations/composio/bus/connection_created_subscriber.rs
index e576fdc3f3..c77ff6d85f 100644
--- a/crates/openhuman-core/src/integrations/composio/bus/connection_created_subscriber.rs
+++ b/crates/openhuman-core/src/integrations/composio/bus/connection_created_subscriber.rs
@@ -78,6 +78,7 @@ impl EventHandler<DomainEvent> for ComposioConnectionCreatedSubscriber {
toolkit,
connection_id,
connect_url: _,
+ tenant,
} = event
else {
return;
@@ -87,11 +88,15 @@ impl EventHandler<DomainEvent> for ComposioConnectionCreatedSubscriber {
connection_id = %connection_id,
"[composio:bus] connection_created"
);
+ let Some(ctx) = DispatchCtx::for_event(tenant.as_ref()) else {
+ tracing::debug!(toolkit = %toolkit, "[composio:bus] connection_created has no tenant; skipped");
+ return;
+ };
// The cache refresh runs for every toolkit; only the profile fetch is gated on a native provider.
let toolkit = toolkit.clone();
let connection_id = connection_id.clone();
tokio::spawn(async move {
- on_connection_created(&DispatchCtx::ambient(), toolkit, connection_id).await
+ on_connection_created(&ctx, toolkit, connection_id).await
});
}
}
diff --git a/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs b/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs
index 3fe678a010..fad9e9b667 100644
--- a/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs
+++ b/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs
@@ -83,7 +83,9 @@ impl EventHandler<DomainEvent> for ComposioTriggerSubscriber {
// let the event through rather than silently dropping it. The
// existing env-var / config triage flags below remain the
// backend-mode gates.
- let ctx = DispatchCtx::ambient();
+ // A trigger arrives over the host's socket, so it belongs to the host's
+ // own tenant; in SaaS it has none and is dropped.
+ let ctx = DispatchCtx::host_default();
if let Ok(config) = ctx.load_config().await {
if config.composio.mode == crate::config::schema::COMPOSIO_MODE_DIRECT {
tracing::info!(
@@ -186,8 +188,6 @@ impl EventHandler<DomainEvent> for ComposioTriggerSubscriber {
// Spawn so the bus dispatch loop stays non-blocking — the
// triage turn is an LLM round-trip that may take seconds.
tokio::spawn(async move {
- // A spawned task does not inherit the handler's task scope: bind its own.
- let ctx = DispatchCtx::ambient();
match run_triage(&ctx, &envelope).await {
Ok(TriageOutcome::Decision(run)) => {
// Remote payload: a Composio trigger body is