Skip to content

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

test(memory): add e2e test for backfill consent and status reporting

Steven Enamakela86f2a79bc5c
diff --git a/tests/memory_v2_e2e.rs b/tests/memory_v2_e2e.rs
index e31fa851a8..4089dd569c 100644
--- a/tests/memory_v2_e2e.rs
+++ b/tests/memory_v2_e2e.rs
@@ -1194,6 +1194,31 @@ async fn context_get_set_and_refresh() {
assert_eq!(read_back["budget_tokens"], json!(500));
}
+#[tokio::test]
+async fn past_conversations_backfill_needs_consent_and_reports_status() {
+ let f = Fixture::new(true).await;
+ let status = f
+ .ok("openhuman.memory_conversations_backfill_status", json!({}))
+ .await;
+ assert_eq!(status["state"]["phase"], json!("idle"), "{status}");
+ assert_eq!(status["pending_threads"], json!(0));
+ assert_eq!(
+ f.code(
+ "openhuman.memory_conversations_backfill_start",
+ json!({ "consent": false })
+ )
+ .await,
+ "INVALID_REQUEST"
+ );
+ let started = f
+ .ok(
+ "openhuman.memory_conversations_backfill_start",
+ json!({ "consent": true }),
+ )
+ .await;
+ assert_eq!(started["pending_turns"], json!(0), "{started}");
+}
+
// ---------------------------------------------------------------------------
// Explorer
// ---------------------------------------------------------------------------