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
feat(memory): add engine_migrate_cancel controller and schema
Steven Enamakelf944db2030c9
diff --git a/crates/openhuman-core/src/memory/schemas/engine.rs b/crates/openhuman-core/src/memory/schemas/engine.rsindex 048a519c9e..8d51d3bded 100644--- a/crates/openhuman-core/src/memory/schemas/engine.rs+++ b/crates/openhuman-core/src/memory/schemas/engine.rs@@ -8,7 +8,9 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::memory::rpc::{self, EngineTargetParams, MigrateParams, MigrateStatusParams};+use crate::memory::rpc::{+ self, EngineTargetParams, MigrateCancelParams, MigrateParams, MigrateStatusParams,+};use super::{parse_params, to_json};@@ -18,6 +20,7 @@ pub(super) const FUNCTIONS: &[&str] = &["engine_set","engine_migrate","engine_migrate_status",+ "engine_migrate_cancel",];pub(super) fn controllers() -> Vec<RegisteredController> {@@ -42,6 +45,10 @@ pub(super) fn controllers() -> Vec<RegisteredController> {schema: schema("engine_migrate_status").unwrap(),handler: handle_engine_migrate_status,},+ RegisteredController {+ schema: schema("engine_migrate_cancel").unwrap(),+ handler: handle_engine_migrate_cancel,+ },]}@@ -184,6 +191,13 @@ pub(super) fn schema(function: &str) -> Option<ControllerSchema> {field("error", opt_string(), "Failure reason; null unless failed.", false),],},+ "engine_migrate_cancel" => ControllerSchema {+ namespace: "memory",+ function: "engine_migrate_cancel",+ description: "Cancel a running engine migration. The copy stops between pages and the active engine is left unchanged.",+ inputs: vec![field("job_id", TypeSchema::String, "Id returned by engine_migrate.", true)],+ outputs: vec![field("cancelled", TypeSchema::Bool, "Whether a running job was signalled; false when it had already finished.", true)],+ },_ => return None,})}@@ -216,3 +230,10 @@ fn handle_engine_migrate_status(params: Map<String, Value>) -> ControllerFutureto_json(rpc::memory_engine_migrate_status(payload).await?)})}++fn handle_engine_migrate_cancel(params: Map<String, Value>) -> ControllerFuture {+ Box::pin(async move {+ let payload = parse_params::<MigrateCancelParams>(params)?;+ to_json(rpc::memory_engine_migrate_cancel(payload).await?)+ })+}diff --git a/crates/openhuman-core/src/memory/schemas/provider.rs b/crates/openhuman-core/src/memory/schemas/provider.rsindex 2adce1b6b8..dd1eae24ab 100644--- a/crates/openhuman-core/src/memory/schemas/provider.rs+++ b/crates/openhuman-core/src/memory/schemas/provider.rs@@ -16,6 +16,7 @@ pub(super) const FUNCTIONS: &[&str] = &["engine_set","engine_migrate","engine_migrate_status",+ "engine_migrate_cancel",];pub(super) fn controllers() -> Vec<RegisteredController> {diff --git a/crates/openhuman-core/src/memory/schemas/provider_tests.rs b/crates/openhuman-core/src/memory/schemas/provider_tests.rsindex a6c0a43f1b..a2192ac913 100644--- a/crates/openhuman-core/src/memory/schemas/provider_tests.rs+++ b/crates/openhuman-core/src/memory/schemas/provider_tests.rs@@ -10,7 +10,8 @@ fn provider_family_exposes_status_and_the_engine_selector() {"engine_get","engine_set","engine_migrate",- "engine_migrate_status"+ "engine_migrate_status",+ "engine_migrate_cancel"]);assert_eq!(controllers().len(), FUNCTIONS.len());diff --git a/crates/openhuman-core/src/memory/schemas_tests.rs b/crates/openhuman-core/src/memory/schemas_tests.rsindex e5ec7be345..222df909af 100644--- a/crates/openhuman-core/src/memory/schemas_tests.rs+++ b/crates/openhuman-core/src/memory/schemas_tests.rs@@ -43,6 +43,7 @@ const ALL_FUNCTIONS: &[&str] = &["engine_set","engine_migrate","engine_migrate_status",+ "engine_migrate_cancel",// Tool-scoped memory (#1400)"tool_rule_put","tool_rule_get",@@ -116,6 +117,7 @@ const REGISTRATION_ORDER: &[&str] = &["engine_set","engine_migrate","engine_migrate_status",+ "engine_migrate_cancel",// tool_memory"tool_rule_put","tool_rule_get",