Skip to content

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

test(threads): cover memory forget queued on thread delete

Steven Enamakeldf72a1b93234
diff --git a/crates/openhuman-core/src/threads/ops_conversion_tests.rs b/crates/openhuman-core/src/threads/ops_conversion_tests.rs
index 3283327116..6c705e68e8 100644
--- a/crates/openhuman-core/src/threads/ops_conversion_tests.rs
+++ b/crates/openhuman-core/src/threads/ops_conversion_tests.rs
@@ -476,3 +476,32 @@ async fn thread_update_title_rejects_empty_and_whitespace_only_titles() {
);
}
}
+
+#[tokio::test]
+async fn thread_delete_forgets_its_conversation_memory_or_queues_it() {
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
+ let workspace = tempfile::tempdir().expect("workspace");
+ let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
+ let thread_id = "thread-delete-memory";
+ create_thread_with_title(&workspace, thread_id, "Chat Jan 1 1:00 AM").await;
+ let dir = crate::config::Config::load_or_init()
+ .await
+ .expect("load config")
+ .workspace_dir;
+
+ thread_delete(DeleteConversationThreadRequest {
+ thread_id: thread_id.to_string(),
+ deleted_at: "2026-01-01T00:02:00Z".into(),
+ })
+ .await
+ .expect("delete thread");
+
+ // Signed out in tests (memory off): the forget is queued for the next
+ // sign-in instead of being skipped.
+ assert_eq!(
+ crate::memory::deletion::pending(&dir),
+ vec![crate::memory::deletion::PendingDeletion::Thread {
+ thread_id: thread_id.to_string()
+ }]
+ );
+}