Skip to content

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

fix(memory): keep a source removal from failing on its sync record

Shanu7953629e438f
diff --git a/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs b/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs
index dddb657eb7..77a2e4e387 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs
@@ -234,8 +234,18 @@ pub async fn remove_rpc(req: RemoveRequest) -> Result<Outcome<RemoveResponse>, S
if removed {
// A removed source is never synced again, so the host's record of
// what it sent goes with it. Its memory stays, as on the local engine.
- let config = config_rpc::load_config_with_timeout().await?;
- crate::memory::sources::hosted_sync::forget_state(&config, &req.id);
+ //
+ // The source is already gone from the registry, so a config that
+ // cannot be read now must not turn the removal into an error: the
+ // caller would retry a removal that already happened. The record is
+ // left behind instead — inert, since nothing syncs the source again.
+ match config_rpc::load_config_with_timeout().await {
+ Ok(config) => crate::memory::sources::hosted_sync::forget_state(&config, &req.id),
+ Err(error) => tracing::warn!(
+ id = %req.id,
+ "[memory_sources] remove_rpc: removed, but could not clear the hosted sync record: {error}"
+ ),
+ }
}
Ok(Outcome::new(RemoveResponse { removed }, vec![]))
}