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
chore: files changed crates/openhuman-core/src/cron/ops.rs,crates/openhuman-core/src/cron/ops_tests.
Steven Enamakel6d2ee176e539
diff --git a/crates/openhuman-core/src/cron/ops.rs b/crates/openhuman-core/src/cron/ops.rsindex c18bcf35c8..76f24488ce 100644--- a/crates/openhuman-core/src/cron/ops.rs+++ b/crates/openhuman-core/src/cron/ops.rs@@ -350,3 +350,7 @@ pub async fn cron_runs(#[cfg(test)]#[path = "ops_tests.rs"]mod tests;++#[cfg(test)]+#[path = "ops_delivery_tests.rs"]+mod delivery_tests;diff --git a/crates/openhuman-core/src/cron/ops_delivery_tests.rs b/crates/openhuman-core/src/cron/ops_delivery_tests.rsnew file mode 100644index 0000000000..82e440cca0--- /dev/null+++ b/crates/openhuman-core/src/cron/ops_delivery_tests.rs@@ -0,0 +1,48 @@+use super::tests::{single_flight_system_job, test_config};+use super::*;+use crate::cron;+use tempfile::TempDir;+use tinyflows_bus::schedule::types::{DeliveryConfig, DeliveryStatus};++#[tokio::test]+async fn run_job_now_keeps_best_effort_failure_successful_and_records_failed_delivery() {+ let tmp = TempDir::new().unwrap();+ let config = test_config(&tmp);+ let _handler = crate::cron::system_job_handlers::register(+ "ops-run-now-best-effort-delivery-failure",+ std::sync::Arc::new(|_ctx| Box::pin(async { Ok(()) })),+ );+ let job = single_flight_system_job(&config, "ops-run-now-best-effort-delivery-failure");+ let missing_channel = format!("missing-{}", uuid::Uuid::new_v4());+ cron::update_job(+ &config,+ &job.id,+ CronJobPatch {+ delivery: Some(DeliveryConfig {+ mode: "announce".into(),+ channel: Some(missing_channel),+ to: Some("target".into()),+ best_effort: true,+ }),+ ..CronJobPatch::default()+ },+ )+ .unwrap();++ let (success, _output) = run_job_now(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &job.id,+ )+ .await+ .unwrap();++ assert!(+ success,+ "best-effort delivery failure preserves execution success"+ );+ let runs = cron::list_runs(&config, &job.id, 10).unwrap();+ assert_eq!(runs.len(), 1);+ assert_eq!(runs[0].status, "ok");+ assert_eq!(runs[0].delivery_status, Some(DeliveryStatus::Failed));+}diff --git a/crates/openhuman-core/src/cron/ops_tests.rs b/crates/openhuman-core/src/cron/ops_tests.rsindex 5714d58ae6..f32deae1a8 100644--- a/crates/openhuman-core/src/cron/ops_tests.rs+++ b/crates/openhuman-core/src/cron/ops_tests.rs@@ -3,7 +3,7 @@ use crate::cron::get_job;use tempfile::TempDir;use tinyflows_bus::schedule::types::{ActiveHours, DeliveryConfig};-fn test_config(tmp: &TempDir) -> Config {+pub(super) fn test_config(tmp: &TempDir) -> Config {let config = Config {workspace_dir: tmp.path().join("workspace"),action_dir: tmp.path().join("workspace"),@@ -529,7 +529,7 @@ async fn cron_run_rejects_duplicate_concurrent_execution() {// ── run_job_now / single-flight ─────────────────────────────────-fn single_flight_system_job(config: &Config, name: &str) -> CronJob {+pub(super) fn single_flight_system_job(config: &Config, name: &str) -> CronJob {let job = crate::cron::system_jobs::ensure_system_job(config,name,@@ -688,46 +688,3 @@ async fn run_job_now_records_required_delivery_failure_as_error() {Some("error"));}--#[tokio::test]-async fn run_job_now_keeps_best_effort_failure_successful_and_records_failed_delivery() {- let tmp = TempDir::new().unwrap();- let config = test_config(&tmp);- let _handler = crate::cron::system_job_handlers::register(- "ops-run-now-best-effort-delivery-failure",- std::sync::Arc::new(|_ctx| Box::pin(async { Ok(()) })),- );- let job = single_flight_system_job(&config, "ops-run-now-best-effort-delivery-failure");- let missing_channel = format!("missing-{}", uuid::Uuid::new_v4());- cron::update_job(- &config,- &job.id,- CronJobPatch {- delivery: Some(DeliveryConfig {- mode: "announce".into(),- channel: Some(missing_channel),- to: Some("target".into()),- best_effort: true,- }),- ..CronJobPatch::default()- },- )- .unwrap();-- let (success, _output) = run_job_now(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &job.id,- )- .await- .unwrap();-- assert!(- success,- "best-effort delivery failure preserves execution success"- );- let runs = cron::list_runs(&config, &job.id, 10).unwrap();- assert_eq!(runs.len(), 1);- assert_eq!(runs[0].status, "ok");- assert_eq!(runs[0].delivery_status, Some(DeliveryStatus::Failed));-}