Skip to content

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

feat(goals): add legacy goal migration to startup sequence

Steven Enamakel5b635fd244d6
diff --git a/crates/openhuman-core/src/agent/goals/mod.rs b/crates/openhuman-core/src/agent/goals/mod.rs
index 5ffe8bee68..7333c006d0 100644
--- a/crates/openhuman-core/src/agent/goals/mod.rs
+++ b/crates/openhuman-core/src/agent/goals/mod.rs
@@ -7,6 +7,7 @@
//! OpenHuman's `Tool` and `StopHook` traits.
pub mod continuation;
+pub mod migration;
pub mod runtime;
pub mod store;
pub mod tools;
diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rs
index eea92bd03e..9c40747c5e 100644
--- a/crates/openhuman-core/src/core/runtime/services.rs
+++ b/crates/openhuman-core/src/core/runtime/services.rs
@@ -380,7 +380,7 @@ fn spawn_module_preload(_config: &Config) {
/// Runs startup housekeeping, then starts one-shot boot background work
/// selected by [`ServiceSet`].
pub async fn start_boot_once_jobs(services: ServiceSet, config: &Config) {
- run_startup_housekeeping(config);
+ run_legacy_migrations(config).await;
// The orphaned-run sweep does NOT live here. It runs in
// `CoreBuilder::build`, which every runtime goes through — these jobs only
@@ -415,7 +415,7 @@ pub async fn start_boot_once_jobs(services: ServiceSet, config: &Config) {
}
}
-fn run_startup_housekeeping(config: &Config) {
+async fn run_legacy_migrations(config: &Config) {
match crate::cron::seed::prune_retired_jobs(config) {
Ok(count) if count > 0 => {
log::info!("[cron] removed {count} retired autopilot job(s)");
@@ -423,6 +423,15 @@ fn run_startup_housekeeping(config: &Config) {
Ok(_) => {}
Err(e) => log::warn!("[cron] failed to prune retired jobs: {e}"),
}
+
+ match crate::agent::goals::migration::migrate_legacy_goals(&config.workspace_dir).await {
+ Ok(report) if report.total > 0 => log::info!(
+ "[thread_goals] legacy→crate migration: total={} copied={} skipped={}",
+ report.total, report.copied, report.skipped
+ ),
+ Ok(_) => {}
+ Err(e) => log::warn!("[thread_goals] legacy→crate migration failed: {e}"),
+ }
}
/// Auto-connect Socket.IO to the backend when enabled by the service selection.