Skip to content

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

fix: simplify digest sort in retention cap enforcement

Steven Enamakeldcb50a0fef00
diff --git a/crates/openhuman-core/src/flows/bus/run_digest.rs b/crates/openhuman-core/src/flows/bus/run_digest.rs
index 8d0bf64232..88eb40a22a 100644
--- a/crates/openhuman-core/src/flows/bus/run_digest.rs
+++ b/crates/openhuman-core/src/flows/bus/run_digest.rs
@@ -152,7 +152,7 @@ pub(super) async fn enforce_retention_cap(
return Ok(0);
}
// Oldest first, so the excess taken below is the stalest digests.
- digests.sort_by(|a, b| a.meta.observed_at.cmp(&b.meta.observed_at));
+ digests.sort_by_key(|digest| digest.meta.observed_at);
let excess = digests.len() - cap;
let ids: Vec<String> = digests
.into_iter()