Skip to content

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

feat(composio): add connection created subscriber and error utils

Steven Enamakel9fe3d41e2bc0
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 1dac998ad4..6613314484 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
@@ -1,7 +1,7 @@
//! Routes `ComposioConnectionCreated` events: once the connection is
//! confirmed active, refreshes the integrations cache, then (after
-//! onboarding) fetches the account profile and starts an initial
-//! `composio_sync` for toolkits with a native sync provider.
+//! onboarding) fetches the account profile for toolkits with a native
+//! identity provider.
use std::time::Duration;
@@ -85,8 +85,7 @@ impl EventHandler<DomainEvent> for ComposioConnectionCreatedSubscriber {
connection_id = %connection_id,
"[composio:bus] connection_created"
);
- // The cache refresh runs for every toolkit; only the profile fetch and
- // initial sync are gated on a native provider.
+ // 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(toolkit, connection_id).await });
@@ -149,7 +148,7 @@ async fn on_connection_created(toolkit: String, connection_id: String) {
connection_id = %connection_id,
last_status = ?last_status,
timeout_secs = CONNECTION_READY_TIMEOUT.as_secs(),
- "[composio:bus] timed out waiting for connection to become active; skipping cache refresh + initial sync"
+ "[composio:bus] timed out waiting for connection to become active; skipping cache refresh"
);
return;
}
@@ -158,7 +157,7 @@ async fn on_connection_created(toolkit: String, connection_id: String) {
toolkit = %toolkit,
connection_id = %connection_id,
error = %error,
- "[composio:bus] backend lookup failed while waiting for connection; skipping cache refresh + initial sync"
+ "[composio:bus] backend lookup failed while waiting for connection; skipping cache refresh"
);
return;
}
@@ -170,14 +169,14 @@ async fn on_connection_created(toolkit: String, connection_id: String) {
tracing::info!(
toolkit = %toolkit,
connection_id = %connection_id,
- "[composio:bus] onboarding not yet complete — skipping profile fetch and initial sync"
+ "[composio:bus] onboarding not yet complete — skipping profile fetch"
);
return;
}
if !crate::integrations::composio::providers::has_native_provider(&toolkit) {
tracing::debug!(
toolkit = %toolkit,
- "[composio:bus] no native sync provider for toolkit; skipping profile fetch and initial sync"
+ "[composio:bus] no native identity provider for toolkit; skipping profile fetch"
);
return;
}
@@ -189,25 +188,6 @@ async fn on_connection_created(toolkit: String, connection_id: String) {
"[composio:bus] connection bootstrap (profile fetch) failed"
);
}
- match ops::composio_sync(
- &live_config,
- &connection_id,
- Some("connection_created".to_string()),
- )
- .await
- {
- Ok(_) => tracing::info!(
- toolkit = %toolkit,
- connection_id = %connection_id,
- "[composio:bus] initial sync started"
- ),
- Err(error) => tracing::debug!(
- toolkit = %toolkit,
- connection_id = %connection_id,
- error = %error,
- "[composio:bus] initial sync not started (memory off or unavailable)"
- ),
- }
}
// ── Connection-readiness polling ────────────────────────────────────
diff --git a/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs b/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs
index 3e35c78d1d..aa5898fae3 100644
--- a/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs
+++ b/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs
@@ -28,11 +28,10 @@ use super::scopes::{
pub use descriptions::toolkit_description;
-/// Toolkits the connector module can sync into memory (`tinyconnectors-sync`'s
-/// provider tree).
+/// Toolkits with a native identity provider (profile facets).
pub const NATIVE_PROVIDERS: &[&str] = &["gmail", "notion", "slack", "clickup", "github", "linear"];
-/// Does `toolkit` have a native sync provider?
+/// Does `toolkit` have a native identity provider?
#[must_use]
pub fn has_native_provider(toolkit: &str) -> bool {
NATIVE_PROVIDERS.contains(&toolkit)
diff --git a/crates/openhuman-core/src/integrations/composio/ops/error_utils.rs b/crates/openhuman-core/src/integrations/composio/ops/error_utils.rs
index 0eca70ce83..e138c1bda3 100644
--- a/crates/openhuman-core/src/integrations/composio/ops/error_utils.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops/error_utils.rs
@@ -79,9 +79,8 @@ pub(crate) fn direct_mode_without_key(config: &Config) -> OpResult<bool> {
/// connector module: `modules::connectors::module_config` fails, `ensure_routed`
/// reconfigures the module with `{"route": "none"}`, and every routed member
/// answers "this module was loaded without a connector route" — which the op
-/// layer then reported at error level (and to Sentry) once at boot from the
-/// every periodic tick, for a user who
-/// simply has not signed in (#6176). Callers answer with the quiet
+/// layer then reported at error level (and to Sentry) on every periodic tick,
+/// for a user who simply has not signed in (#6176). Callers answer with the quiet
/// [`COMPOSIO_NO_SESSION`] error instead — deliberately not an empty list,
/// unlike the direct-mode guard: no key means no tenant and truly no
/// connections, whereas no session only means the connections cannot be