Skip to content

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

fix(memory): bulk-ingest module members need the slow deadline too\n\nField RCA, second hop of the same pathology the connector Sync fix\nclosed: with Sync finishing under its sized deadline, the host then hands\nthe fetched page to the memory module -- 200 Gmail records in one\nAcceptSourceItems call -- and that member still sat on the default 30s\nbus deadline. Embedding and writing the page takes longer; the call timed\nout, the run was marked failed, the sync scheduler retried every few\nminutes, and the Sync button span forever while the chunk count never\nmoved.\n\nmodule_call_slow! mirrors the connector client's call_slow (15-minute\nproxy deadline) and the three batch members ride it: accept_source_items,\ningest_chat, ingest_email. Single-item ingest_document stays on the\ndefault deadline deliberately -- a one-item call that needs 30s is a\ndifferent bug, and should keep failing loudly at 30s.\n

Shanuf6bda644b65a
diff --git a/src/openhuman/modules/memory_part_01.rs b/src/openhuman/modules/memory_part_01.rs
index 8559362107..9497355acf 100644
--- a/src/openhuman/modules/memory_part_01.rs
+++ b/src/openhuman/modules/memory_part_01.rs
@@ -674,15 +674,35 @@ macro_rules! module_call {
};
}
+/// [`module_call!`] with a deadline sized for bulk work.
+///
+/// The default bus deadline (30s) fits request-shaped members. The bulk
+/// ingest members are not that: `AcceptSourceItems` embeds and writes a whole
+/// connector page of records inside the call — a 200-email Gmail handoff
+/// blew the 30s deadline live while the module went on to finish the work,
+/// and the sync retry loop then re-ran the same handoff forever. Same
+/// pathology, and same fix, as the connector module's `Sync` member.
+macro_rules! module_call_slow {
+ ($self:expr, $operation:literal, $method:expr, $args:expr) => {
+ $self
+ .proxy($operation)
+ .await?
+ .with_timeout(std::time::Duration::from_secs(15 * 60))
+ .call($method, $args)
+ .await
+ .map_err(|error| from_bus(&error))
+ };
+}
+
#[async_trait]
impl MemoryIngest for ModuleMemoryProvider {
async fn ingest_document(&self, item: IngestItem) -> Result<IngestOutcome, MemoryError> {
module_call!(self, "ingest_document", methods::INGEST_DOCUMENT, (item,))
}
async fn ingest_chat(&self, messages: Vec<IngestItem>) -> Result<IngestOutcome, MemoryError> {
- module_call!(self, "ingest_chat", methods::INGEST_CHAT, (messages,))
+ module_call_slow!(self, "ingest_chat", methods::INGEST_CHAT, (messages,))
}
async fn ingest_email(&self, messages: Vec<IngestItem>) -> Result<IngestOutcome, MemoryError> {
- module_call!(self, "ingest_email", methods::INGEST_EMAIL, (messages,))
+ module_call_slow!(self, "ingest_email", methods::INGEST_EMAIL, (messages,))
}
}
diff --git a/src/openhuman/modules/memory_part_02.rs b/src/openhuman/modules/memory_part_02.rs
index f486a5e897..47394510b3 100644
--- a/src/openhuman/modules/memory_part_02.rs
+++ b/src/openhuman/modules/memory_part_02.rs
@@ -486,7 +486,7 @@ impl MemorySourceSink for ModuleMemoryProvider {
items: Vec<SourceItem>,
taint: MemoryTaint,
) -> Result<IngestOutcome, MemoryError> {
- module_call!(
+ module_call_slow!(
self,
"accept_source_items",
methods::ACCEPT_SOURCE_ITEMS,