Skip to content

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

feat(storage): import legacy cron jobs without the flows feature

Steven Enamakelb6257bd0bcf1
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index 6e2867c0f7..d2b3b36159 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -92,9 +92,10 @@ tinyflows-copilot = { path = "../../vendor/tinyflows/crates/tinyflows-copilot",
# Reads the stores tinyflows hosts used before storage moved onto the ports
# (`flows.db`, `jobs.db`, `checkpoints.db`, drafts) and copies them into the
# port-backed stores, read-only (`storage::import`). It needs the engine and the
-# catalog, so it rides the `flows` gate; a build without `flows` imports no
-# legacy cron jobs.
-tinyflows-import = { path = "../../vendor/tinyflows/crates/tinyflows-import", optional = true }
+# catalog, so those importers ride the `flows` gate (`tinyflows-import/engine`,
+# `store`, `catalog`); the `schedule` importer is always on, so a build without
+# `flows` still imports legacy cron jobs.
+tinyflows-import = { path = "../../vendor/tinyflows/crates/tinyflows-import", default-features = false, features = ["schedule"] }
# TinyAgents — Rust LLM orchestration framework (LangGraph/LangChain-style):
# durable state graphs, agent-loop harness, model/tool registries, REPL +
# `.rag` workflow language. openhuman's agent engine + orchestration run on this
@@ -748,7 +749,7 @@ media = ["tinyagents-harness/media"]
# runtime `DomainSet::flows` flag (#4796): the feature narrows the compile-time
# surface, `DomainSet` gates it at runtime.
# NOTE: this gate does NOT drop `tinyagents` itself — 26+ domains consume it.
-flows = ["modules", "dep:tinyflows", "dep:tinyflows-catalog", "dep:tinyflows-copilot", "dep:tinyflows-import", "tinyflows-drivers/catalog"]
+flows = ["modules", "dep:tinyflows", "dep:tinyflows-catalog", "dep:tinyflows-copilot", "tinyflows-import/engine", "tinyflows-import/store", "tinyflows-import/catalog", "tinyflows-drivers/catalog"]
# Skills domains: `openhuman::skills` (metadata/discovery/install),
# `openhuman::skill_runtime` (SKILL.md execution + the skill_executor agent),
# and `openhuman::skill_registry` (remote catalogs + the skill_setup agent).
diff --git a/crates/openhuman-core/src/storage/import/tinyflows.rs b/crates/openhuman-core/src/storage/import/tinyflows.rs
index 2efba1d2aa..726704d375 100644
--- a/crates/openhuman-core/src/storage/import/tinyflows.rs
+++ b/crates/openhuman-core/src/storage/import/tinyflows.rs
@@ -102,7 +102,6 @@ pub(super) fn marked(
/// `(found, written, skipped)` of a `tinyflows-import` report; problems are logged by
/// id only, never with record content.
-#[cfg(feature = "flows")]
fn counts(domain: &str, report: &tinyflows_import::ImportReport) -> (usize, usize, usize) {
for problem in report.problems() {
tracing::warn!(
@@ -182,7 +181,6 @@ pub fn import_flows(
///
/// When the legacy file exists but cannot be read, or the backend fails. The
/// legacy file is untouched either way.
-#[cfg(feature = "flows")]
pub fn import_cron(
backend: &Arc<dyn StorageBackend>,
scope: &Scope,
@@ -234,15 +232,24 @@ fn agent_cron_dirs(workspace: &Path) -> Vec<(String, PathBuf)> {
}
/// Imports every tinyflows legacy store of `config`'s workspace into
-/// `backend`: the flow catalog and checkpoints, the workspace's cron jobs and
-/// each agent's. One [`Report`] per store; a failure in one does not stop the
-/// rest.
-#[cfg(feature = "flows")]
+/// `backend`: the flow catalog and checkpoints (only in a build with `flows`),
+/// the workspace's cron jobs and each agent's. One [`Report`] per store; a
+/// failure in one does not stop the rest. The cron importer needs only the
+/// `schedule` reader, so a build without `flows` still keeps its cron jobs.
pub fn run_with(backend: &Arc<dyn StorageBackend>, config: &Config) -> Vec<Report> {
- let mut reports = vec![finish(
+ let mut reports = Vec::new();
+ #[cfg(feature = "flows")]
+ reports.push(finish(
FLOWS_DOMAIN,
import_flows(backend, &Scope::local(), config),
- )];
+ ));
+ #[cfg(not(feature = "flows"))]
+ if config.workspace_dir.join("flows").exists() {
+ tracing::warn!(
+ target: "openhuman::storage_import",
+ "[storage::import] built without `flows`; the legacy flow catalog is not imported"
+ );
+ }
reports.push(finish(
CRON_DOMAIN,
import_cron(backend, &Scope::local(), config, &config.workspace_dir, ""),
@@ -257,21 +264,6 @@ pub fn run_with(backend: &Arc<dyn StorageBackend>, config: &Config) -> Vec<Repor
reports
}
-/// Without `flows` there is no reader for the tinyflows formats; say so
-/// instead of silently dropping cron jobs.
-#[cfg(not(feature = "flows"))]
-pub fn run_with(_backend: &Arc<dyn StorageBackend>, config: &Config) -> Vec<Report> {
- if legacy_jobs_db(&config.workspace_dir).is_file()
- || !agent_cron_dirs(&config.workspace_dir).is_empty()
- {
- tracing::warn!(
- target: "openhuman::storage_import",
- "[storage::import] built without `flows`; the legacy cron databases are not imported"
- );
- }
- Vec::new()
-}
-
pub(super) fn finish(domain: &'static str, outcome: Result<Outcome>) -> Report {
match &outcome {
Ok(Outcome::Imported { found, written }) => tracing::info!(