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
test(tinyagents): add reaper tests for stale agent cleanup
Steven Enamakel80d413d31e0a
diff --git a/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs b/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rsindex 4dc771292f..2f7b42458c 100644--- a/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs@@ -3,12 +3,11 @@ use super::*;use tinyagents_harness::events::HarnessRunStatus;use tinyagents_harness::ids::{ComponentId, ExecutionStatus, HarnessPhase};use tinyagents_harness::observability::{- mint_run_id, FileStatusStore, HarnessStatusStore, ORPHAN_REAP_REASON,+ mint_run_id, DriverStatusStore, HarnessStatusStore, ORPHAN_REAP_REASON,};-use tinyagents_session::transcript::import::ops::open_session_stores;/// Build a fresh status in a non-terminal state and persist it.-async fn seed_status(store: &FileStatusStore, status_kind: ExecutionStatus) -> String {+async fn seed_status(store: &DriverStatusStore, status_kind: ExecutionStatus) -> String {let run_id = mint_run_id();let mut status =HarnessRunStatus::new(run_id.clone(), ComponentId::new("mock-model".to_string()));@@ -26,7 +25,7 @@ async fn seed_status(store: &FileStatusStore, status_kind: ExecutionStatus) -> Sasync fn workspace_adapter_reaps_and_empty_workspace_is_a_noop() {let tmp = std::env::temp_dir().join(format!("oh-reaper-{}", uuid::Uuid::new_v4()));assert_eq!(reap_orphaned_runs(&tmp).await, 0);- let store = FileStatusStore::new(open_session_stores(&tmp).kv);+ let store = crate::agent::session_store::status_store_for(&tmp);let run = seed_status(&store, ExecutionStatus::Running).await;assert_eq!(reap_orphaned_runs(&tmp).await, 1);let status = store.get_status(&run).await.unwrap().expect("present");@@ -39,7 +38,7 @@ async fn workspace_adapter_reaps_and_empty_workspace_is_a_noop() {#[tokio::test]async fn a_shared_backend_leaves_running_work_alone() {let tmp = std::env::temp_dir().join(format!("oh-reaper-{}", uuid::Uuid::new_v4()));- let store = FileStatusStore::new(open_session_stores(&tmp).kv);+ let store = crate::agent::session_store::status_store_for(&tmp);let run = seed_status(&store, ExecutionStatus::Running).await;assert_eq!(reap_unless_shared(&tmp, true).await, 0);let status = store.get_status(&run).await.unwrap().expect("present");@@ -80,7 +79,7 @@ async fn a_build_only_runtime_is_swept_before_it_can_be_invoked() {// `OPENHUMAN_WORKSPACE` names the root; the resolved workspace is the// `workspace` directory under it, which is what the sweep will read.let workspace = tmp.join("workspace");- let store = FileStatusStore::new(open_session_stores(&workspace).kv);+ let store = crate::agent::session_store::status_store_for(&workspace);let orphan = seed_status(&store, ExecutionStatus::Running).await;assert_eq!(store.list_active().await.unwrap().len(), 1);@@ -108,7 +107,7 @@ async fn a_build_only_runtime_is_swept_before_it_can_be_invoked() {// The child writes the durable store in a separate process. Reopen it for// verification instead of reading through the parent's handle, whose// refactored KV layer may still serve the status it cached while seeding.- let after_store = FileStatusStore::new(open_session_stores(&workspace).kv);+ let after_store = crate::agent::session_store::status_store_for(&workspace);let after = after_store.get_status(&orphan).await