Skip to content

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

feat(cron): add cron configuration schema

Steven Enamakelbbd43d9b2767
diff --git a/crates/openhuman-core/src/config/schema/cron.rs b/crates/openhuman-core/src/config/schema/cron.rs
index e810da11b2..ccfed6cac7 100644
--- a/crates/openhuman-core/src/config/schema/cron.rs
+++ b/crates/openhuman-core/src/config/schema/cron.rs
@@ -11,6 +11,29 @@ pub struct CronConfig {
pub enabled: bool,
#[serde(default = "default_cron_max_run_history")]
pub max_run_history: usize,
+ /// Operator-owned mode for hosted deployments: only agent jobs bound to
+ /// the conversation that created them. Shell and flow jobs are refused
+ /// at add, update, run and dispatch; delivery is limited to `origin` and
+ /// `none`; recurring jobs must keep to [`Self::min_interval_secs`] and
+ /// the number of enabled jobs to [`Self::max_active_jobs`].
+ #[serde(default)]
+ pub agent_jobs_only: bool,
+ /// With `agent_jobs_only`: the shortest gap allowed between runs of a
+ /// recurring job.
+ #[serde(default = "default_min_interval_secs")]
+ pub min_interval_secs: u64,
+ /// With `agent_jobs_only`: the most enabled jobs the store may hold for
+ /// one profile, counted in the store.
+ #[serde(default = "default_max_active_jobs")]
+ pub max_active_jobs: u32,
+}
+
+fn default_min_interval_secs() -> u64 {
+ 300
+}
+
+fn default_max_active_jobs() -> u32 {
+ 20
}
fn default_cron_enabled() -> bool {
@@ -26,6 +49,9 @@ impl Default for CronConfig {
Self {
enabled: default_cron_enabled(),
max_run_history: default_cron_max_run_history(),
+ agent_jobs_only: false,
+ min_interval_secs: default_min_interval_secs(),
+ max_active_jobs: default_max_active_jobs(),
}
}
}