The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(composio): seal the summary tree after a connector sync writes\n\nTree ingest writes its L0 chunk rows synchronously, but the Memory Tree graph\nand tree-backed recall read *sealed* summaries. A buffer seals on the 50k-token\n`INPUT_TOKEN_BUDGET` or, failing that, on the seven-day\n`DEFAULT_FLUSH_AGE_SECS` force-flush — and nothing on the sync path ever asked\nfor a seal.\n\nSo a large first backfill crossed the token budget repeatedly and looked fine,\nwhile an incremental sync of a handful of messages stayed under it and those\nmemories were invisible for up to a week, with the source row reporting them\ningested the whole time.\n\n`run_sync_pass` now asks the driver to seal once a pass has written something,\nvia `MemoryMaintenance::flush_pending()` (`max_age_secs = 0`, so every buffer is\nconsidered rather than only the stale ones). The enqueue wakes the seal worker,\nso the wait becomes queue-claim plus summariser latency instead of days.\n\nPlaced inside `run_sync_pass` rather than at its callers because it has three\nof them — the budgeted loop here, the Slack trigger RPC and the sync bus — and\none rule spread across call sites is exactly what caused #6007.\n\nAsking once per page is affordable because the queue dedupes on\n`date + hour/3`: while a flush is ready/running the later pages answer\n`enqueued: false` and ride it. The dedupe is a partial unique index over\nready/running rows only, so a completed flush leaves the index and the next\nenqueue succeeds — the three-hour block is the key's granularity, not a\ncooldown.\n\nBest-effort by construction: gated on `written > 0`, a driver serving no\nMaintenance is skipped, and a flush error is a warn. The records are already\ncommitted and an unsealed buffer is a delay rather than a loss, so nothing here\nmay turn a successful sync into a failed one.\n\nTwo residual behaviours are documented in the PR rather than papered over: the\nflush is workspace-wide, so a connector sync also seals what folder and\ngithub_repo sources left pending; and if a flush is already running when a\npass commits, the suppressed enqueue leaves those items for the next sync (the\nperiodic tick does not rescue them — it enqueues the default seven-day age).\n\nRefs #6007\n
Shanu4ce7c126c2dd
diff --git a/src/openhuman/integrations/composio/ops/providers_ops.rs b/src/openhuman/integrations/composio/ops/providers_ops.rsindex c4d810774b..0cf8daed5b 100644--- a/src/openhuman/integrations/composio/ops/providers_ops.rs+++ b/src/openhuman/integrations/composio/ops/providers_ops.rs@@ -503,6 +503,56 @@ pub(crate) async fn run_sync_pass(.await.map_err(|error| format!("ingesting {toolkit} records failed: {error}"))?;+ // openhuman#6007: ask for the summary tree to be sealed once this pass has+ // written something.+ //+ // Tree ingest writes its L0 chunk rows synchronously, but the Memory Tree+ // graph and tree-backed recall read *sealed* summaries. A buffer seals on+ // the 50k-token budget or, failing that, on the seven-day+ // `DEFAULT_FLUSH_AGE_SECS` force-flush — and nothing on the sync path ever+ // asked for one. So an incremental run of a handful of messages stayed+ // under the budget and its memories were invisible for up to a week, while+ // the source row reported them ingested the entire time.+ //+ // `flush_pending` enqueues a flush with `max_age_secs = 0`, so every buffer+ // is considered rather than only the stale ones. The engine dedupes it on+ // `date + hour/3`, which is what makes asking once per page affordable:+ // after the first writing page the rest answer `enqueued: false` and ride+ // the job already scheduled. That three-hour window is also the residual+ // latency ceiling, and it is the engine's dedupe key — not something a host+ // can shorten from here.+ //+ // Here rather than at the callers: `run_sync_pass` has three of them (the+ // budgeted loop in this file, the Slack trigger RPC, and the sync bus), and+ // one rule spread across call sites is exactly what caused #6007 — two+ // would have got the flush and the third would have been forgotten.+ //+ // Best-effort by construction. The records are committed; an unsealed+ // buffer is a delay, not a loss, and the scheduled flush still sits behind+ // it. Nothing here may turn a successful sync into a failed one.+ if outcome.written > 0 {+ match binding.provider().as_maintenance() {+ Some(maintenance) => match maintenance.flush_pending().await {+ Ok(flush) => tracing::debug!(+ toolkit = %toolkit,+ enqueued = flush.enqueued,+ stale_buffers = flush.stale_buffers,+ "[composio] summary-tree flush requested after sync pass"+ ),+ Err(error) => tracing::warn!(+ toolkit = %toolkit,+ error = %error,+ "[composio] summary-tree flush could not be enqueued; ingested \+ records stay unsealed until the scheduled flush reaches them"+ ),+ },+ None => tracing::debug!(+ driver = %binding.driver_id(),+ "[composio] bound driver serves no Maintenance; skipping the post-sync flush"+ ),+ }+ }+if !response.batch.complete {// The module keeps its own cursor, so the next call resumes where this// one stopped. Saying so is worth a line: a partial run that looked