Skip to content

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

chore(cron): remove unused scheduler and tinyflows code

Steven Enamakel630bc2adf05c
diff --git a/crates/openhuman-core/src/cron/scheduler.rs b/crates/openhuman-core/src/cron/scheduler.rs
index 1e0daecb66..e7447a6705 100644
--- a/crates/openhuman-core/src/cron/scheduler.rs
+++ b/crates/openhuman-core/src/cron/scheduler.rs
@@ -152,9 +152,12 @@ pub async fn run_live_agent_pass(max_concurrent: usize) {
/// Whether an agent can have jobs to poll: with a storage backend its jobs
/// live in the backend under its scope (`crate::storage`), so there is always
-/// something to ask; without one, only once its own `jobs.db` exists.
+/// something to ask; without one, only once its own store exists, or the
+/// `jobs.db` tinyflows used to write there (which the first call imports).
pub(crate) fn agent_jobs_may_exist(config: &Config) -> bool {
- crate::storage::installed().is_some() || crate::cron::store::db_path(config).exists()
+ crate::storage::installed().is_some()
+ || crate::cron::store::db_path(config).exists()
+ || crate::cron::store::legacy_db_path(config).exists()
}
/// Single poll cycle of the scheduler loop, extracted so tests can drive
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
index cf3d5e4c53..f9e8d6856f 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
@@ -12,7 +12,6 @@
use std::sync::Arc;
-use crate::flows::tinyflows::checkpoint_sqlite::SqliteCheckpointer;
use anyhow::Context;
use async_trait::async_trait;
use serde_json::{json, Value};
@@ -663,35 +662,20 @@ pub fn build_capabilities(config: Arc<Config>, state_namespace: impl Into<String
}
/// Opens the durable, cross-process checkpointer a `flows_run` uses via
-/// `tinyflows::engine::run_with_checkpointer` — this host's
-/// [`SqliteCheckpointer`], stored under `<workspace_dir>/flows/checkpoints.db`,
-/// or, when the host configured a storage backend ([`crate::storage`]),
-/// `tinyflows_drivers::DriverCheckpointer` over it in the acting agent's scope.
+/// `tinyflows::engine::run_with_checkpointer`:
+/// `tinyflows_drivers::DriverCheckpointer` over the flow catalog's storage
+/// ([`crate::flows::store`]) in the acting agent's scope.
///
-/// It became host-owned when tinyflows vendored its state-graph runtime and
-/// dropped the SQLite backend with it (tinyflows PR #43). The port keeps the
-/// schema and SQL byte-identical, so an existing `checkpoints.db` — and any
-/// run interrupted before the upgrade — resumes unchanged. See
-/// [`super::super::checkpoint_sqlite`].
+/// tinyflows no longer has a SQLite checkpointer; the `checkpoints.db` it wrote
+/// is imported once, so a run interrupted before the upgrade still resumes.
pub fn open_flow_checkpointer(
config: &Config,
) -> anyhow::Result<Arc<dyn tinyflows::engine::Checkpointer<serde_json::Value>>> {
- if let Some(scoped) = crate::storage::current_scoped()? {
- tracing::debug!(target: "flows", "[flows] opening checkpointer on the storage backend");
- return Ok(Arc::new(tinyflows_drivers::DriverCheckpointer::<
- serde_json::Value,
- >::new(Arc::clone(scoped.documents()))));
- }
- let db_path = config.workspace_dir.join("flows").join("checkpoints.db");
- if let Some(parent) = db_path.parent() {
- std::fs::create_dir_all(parent)
- .with_context(|| format!("Failed to create flows directory: {}", parent.display()))?;
- }
- tracing::debug!(target: "flows", db = %db_path.display(), "[flows] opening checkpointer");
- Ok(Arc::new(
- SqliteCheckpointer::<serde_json::Value>::open(&db_path)
- .with_context(|| format!("Failed to open flows checkpointer: {}", db_path.display()))?,
- ))
+ let scoped = crate::flows::store::scoped(config)?;
+ tracing::debug!(target: "flows", "[flows] opening checkpointer on the flow storage");
+ Ok(Arc::new(tinyflows_drivers::DriverCheckpointer::<
+ serde_json::Value,
+ >::new(Arc::clone(scoped.documents()))))
}
#[cfg(test)]
diff --git a/crates/openhuman-core/src/flows/tinyflows/mod.rs b/crates/openhuman-core/src/flows/tinyflows/mod.rs
index 457927b27d..2a5887780c 100644
--- a/crates/openhuman-core/src/flows/tinyflows/mod.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/mod.rs
@@ -24,11 +24,5 @@ pub mod state;
#[path = "tinyflows_tests.rs"]
mod tests;
-/// The durable SQLite checkpoint store. It lives in `tinyflows-sqlite` — the
-/// schema and the on-disk format are shared with every host that resumes an
-/// interrupted run — and is re-exported under its historical name so existing
-/// `tinyflows::checkpoint_sqlite::…` paths keep resolving.
-pub use tinyflows_sqlite::checkpoint as checkpoint_sqlite;
-
pub use caps::{build_capabilities, open_flow_checkpointer};
pub use memory_adapter::OpenHumanMemory;