Skip to content

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

fix(memory): two more live-test finds -- Sync deadline, tree CLI policy

Shanu04510a61912b
diff --git a/src/openhuman/integrations/composio/module_client.rs b/src/openhuman/integrations/composio/module_client.rs
index 94e4ea1c32..ec5d4edf54 100644
--- a/src/openhuman/integrations/composio/module_client.rs
+++ b/src/openhuman/integrations/composio/module_client.rs
@@ -108,6 +108,23 @@ where
.map_err(|error| normalize_error(member, error))
}
+/// Call a long-running member with a deadline sized for it (see
+/// `modules::connectors::call_slow` for why `Sync` needs one).
+#[cfg(feature = "modules")]
+pub async fn call_slow<Request, Reply>(
+ config: &crate::openhuman::config::Config,
+ member: &str,
+ request: Request,
+) -> Result<Reply, String>
+where
+ Request: serde::Serialize + Send,
+ Reply: serde::de::DeserializeOwned,
+{
+ crate::openhuman::modules::connectors::call_slow(config, member, request)
+ .await
+ .map_err(|error| normalize_error(member, error))
+}
+
/// Call one member with an argument. Always fails without the `modules` feature.
///
/// # Errors
@@ -126,6 +143,24 @@ where
Err(format!("{member}: {WITHOUT_MODULES}"))
}
+/// Call a long-running member. Always fails without the `modules` feature.
+///
+/// # Errors
+///
+/// Always, explaining that this build has no module loader.
+#[cfg(not(feature = "modules"))]
+pub async fn call_slow<Request, Reply>(
+ _config: &crate::openhuman::config::Config,
+ member: &str,
+ _request: Request,
+) -> Result<Reply, String>
+where
+ Request: serde::Serialize + Send,
+ Reply: serde::de::DeserializeOwned,
+{
+ Err(format!("{member}: {WITHOUT_MODULES}"))
+}
+
/// Call a member that takes no arguments.
///
/// # Errors
diff --git a/src/openhuman/integrations/composio/ops/providers_ops.rs b/src/openhuman/integrations/composio/ops/providers_ops.rs
index 0d52a152c2..908ee15b92 100644
--- a/src/openhuman/integrations/composio/ops/providers_ops.rs
+++ b/src/openhuman/integrations/composio/ops/providers_ops.rs
@@ -301,7 +301,9 @@ pub(crate) async fn run_sync_pass(
connection_id: &str,
reason: &str,
) -> Result<SyncPassOutcome, String> {
- let response = connectors::call::<_, ConnectorSyncResponse>(
+ // Sync pages the whole account inside the call; the default 30s bus
+ // deadline reported failure on runs the module then finished successfully.
+ let response = connectors::call_slow::<_, ConnectorSyncResponse>(
config,
methods::SYNC,
ConnectorSyncRequest {
diff --git a/src/openhuman/memory/tree/tree_runtime/cli.rs b/src/openhuman/memory/tree/tree_runtime/cli.rs
index 845c48dae1..da774ab716 100644
--- a/src/openhuman/memory/tree/tree_runtime/cli.rs
+++ b/src/openhuman/memory/tree/tree_runtime/cli.rs
@@ -345,6 +345,17 @@ async fn load_config() -> Result<crate::openhuman::config::Config> {
.await
.unwrap_or_default();
config.apply_env_overrides();
+
+ // Every subcommand reaches the memory driver, and since the round-2
+ // migration that is a module binding: without the host policy published
+ // the driver binds but its first call fails with "the module host policy
+ // was never published". The server publishes it during boot; this CLI is
+ // its own process and must do the same (the `memory` subcommand family
+ // already does, in memory_cli.rs). Idempotent, so once per load is fine.
+ crate::openhuman::memory::host::install_memory_event_sink();
+ #[cfg(feature = "modules")]
+ crate::openhuman::modules::memory::set_modules_policy(std::sync::Arc::new(config.clone()));
+
Ok(config)
}
diff --git a/src/openhuman/modules/connectors.rs b/src/openhuman/modules/connectors.rs
index b536aa775a..8ebb26c881 100644
--- a/src/openhuman/modules/connectors.rs
+++ b/src/openhuman/modules/connectors.rs
@@ -252,6 +252,35 @@ where
.map_err(|error| format!("{member}: {error}"))
}
+/// Call a long-running member with a deadline sized for it.
+///
+/// The default bus deadline (30s) fits request-shaped members. `Sync` is not
+/// one: the module pages a whole connected account through inside the call —
+/// "a full sync is minutes of paging" is its own documentation — and a 30s
+/// deadline made the host report failure while the module went on to finish
+/// (observed live: timeout at 30s, `run finished … ingested=200` at 38s, and
+/// a Sync button that spun forever on a run that had actually succeeded).
+///
+/// # Errors
+///
+/// As [`call`].
+pub async fn call_slow<Request, Reply>(
+ config: &Config,
+ member: &str,
+ request: Request,
+) -> Result<Reply, String>
+where
+ Request: Serialize + Send,
+ Reply: DeserializeOwned,
+{
+ const SLOW_MEMBER_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(15 * 60);
+ let proxy = proxy(config).await?.with_timeout(SLOW_MEMBER_TIMEOUT);
+ proxy
+ .call::<Reply>(member, (request,))
+ .await
+ .map_err(|error| format!("{member}: {error}"))
+}
+
/// Call a member that takes no arguments.
///
/// # Errors