Skip to content

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

refactor(config): remove memory sync settings and unused memory backend fields

Steven Enamakel841e086ae7c7
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rs
index 10b7ce0216..a21c41b671 100644
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@ -76,19 +76,6 @@ pub struct AgentPathsPatch {
pub files_dir: Option<String>,
}
-/// Patch for the global memory-sync cadence (#3302).
-///
-/// `sync_interval_secs` carries the new value to store in
-/// [`Config::memory_sync_interval_secs`]:
-/// - omitted / `null` → reset to "use the default cadence" (`None`)
-/// - `0` → "Manual only" (periodic auto-sync disabled)
-/// - `n > 0` → sync every `n` seconds (applied per source as a floor over the
-/// provider default by the scheduler)
-#[derive(Debug, Default)]
-pub struct MemorySyncSettingsPatch {
- pub sync_interval_secs: Option<u64>,
-}
-
/// Updates the `[autonomy]` (agent access mode) settings in the configuration.
///
/// After saving, publishes a `DomainEvent::System(AutonomyConfigChanged)` so that
@@ -691,60 +678,3 @@ pub async fn get_agent_paths() -> Result<Outcome<serde_json::Value>, String> {
)],
))
}
-
-fn memory_sync_settings_value(stored: Option<u64>) -> serde_json::Value {
- let is_manual = stored == Some(0);
- let is_default = stored.is_none();
- let selected_secs = stored.unwrap_or(crate::config::DEFAULT_MEMORY_SYNC_INTERVAL_SECS);
- json!({
- "sync_interval_secs": stored,
- "selected_secs": selected_secs,
- "is_manual": is_manual,
- "is_default": is_default,
- "default_secs": crate::config::DEFAULT_MEMORY_SYNC_INTERVAL_SECS,
- "presets": crate::config::MEMORY_SYNC_INTERVAL_PRESETS_SECS,
- })
-}
-
-/// Returns the current global memory-sync cadence and its derived view.
-pub async fn get_memory_sync_settings() -> Result<Outcome<serde_json::Value>, String> {
- let config = load_config_with_timeout().await?;
- let value = memory_sync_settings_value(config.memory_sync_interval_secs);
- Ok(Outcome::single_log(value, "memory sync settings read"))
-}
-
-/// Updates the global memory-sync cadence and persists it. The running
-/// scheduler reads `config.memory_sync_interval_secs` fresh on each tick, so
-/// the new cadence takes effect from the next tick without a restart.
-pub async fn apply_memory_sync_settings(
- config: &mut Config,
- update: MemorySyncSettingsPatch,
-) -> Result<Outcome<serde_json::Value>, String> {
- config.memory_sync_interval_secs = update.sync_interval_secs;
- config.save().await.map_err(|e| e.to_string())?;
-
- tracing::info!(
- sync_interval_secs = ?config.memory_sync_interval_secs,
- "[config:memory_sync] memory sync interval updated"
- );
-
- let stored = config.memory_sync_interval_secs;
- let value = memory_sync_settings_value(stored);
- let msg = match stored {
- Some(0) => "memory sync set to Manual only".to_string(),
- Some(n) => format!("memory sync interval set to {n}s"),
- None => "memory sync interval reset to default".to_string(),
- };
- Ok(Outcome::new(
- value,
- vec![format!("{msg} — saved to {}", config.config_path.display())],
- ))
-}
-
-/// Loads the configuration, applies memory-sync settings, and saves it.
-pub async fn load_and_apply_memory_sync_settings(
- update: MemorySyncSettingsPatch,
-) -> Result<Outcome<serde_json::Value>, String> {
- let mut config = load_config_with_timeout().await?;
- apply_memory_sync_settings(&mut config, update).await
-}
diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rs
index 07cc8033ce..fef028d7d7 100644
--- a/crates/openhuman-core/src/config/ops/mod.rs
+++ b/crates/openhuman-core/src/config/ops/mod.rs
@@ -14,11 +14,10 @@ mod ui;
pub use agent::redact_home;
pub use agent::{
add_auto_approve_tool, apply_agent_paths_settings, apply_agent_settings,
- apply_autonomy_settings, apply_memory_sync_settings, ensure_agent_dirs, ensure_usable_cwd,
- expand_tilde, get_agent_paths, get_agent_settings, get_autonomy_settings,
- get_memory_sync_settings, load_and_apply_agent_paths_settings, load_and_apply_agent_settings,
- load_and_apply_autonomy_settings, load_and_apply_memory_sync_settings, AgentPathsPatch,
- AgentSettingsPatch, AutonomySettingsPatch, MemorySyncSettingsPatch,
+ apply_autonomy_settings, ensure_agent_dirs, ensure_usable_cwd, expand_tilde,
+ get_agent_paths, get_agent_settings, get_autonomy_settings,
+ load_and_apply_agent_paths_settings, load_and_apply_agent_settings,
+ load_and_apply_autonomy_settings, AgentPathsPatch, AgentSettingsPatch, AutonomySettingsPatch,
};
pub use loader::{
diff --git a/crates/openhuman-core/src/config/schemas/controllers/agent.rs b/crates/openhuman-core/src/config/schemas/controllers/agent.rs
index b1ead496ca..3f32dccd9a 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/agent.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/agent.rs
@@ -131,20 +131,6 @@ pub(super) fn handle_set_browser_allow_all(params: Map<String, Value>) -> Contro
})
}
-pub(super) fn handle_get_memory_sync_settings(_params: Map<String, Value>) -> ControllerFuture {
- Box::pin(async move { to_json(config_rpc::get_memory_sync_settings().await?) })
-}
-
-pub(super) fn handle_update_memory_sync_settings(params: Map<String, Value>) -> ControllerFuture {
- Box::pin(async move {
- let update = deserialize_params::<MemorySyncSettingsUpdate>(params)?;
- let patch = config_rpc::MemorySyncSettingsPatch {
- sync_interval_secs: update.sync_interval_secs,
- };
- to_json(config_rpc::load_and_apply_memory_sync_settings(patch).await?)
- })
-}
-
pub(super) fn handle_get_sandbox_settings(_params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move { to_json(config_rpc::get_sandbox_settings().await?) })
}
diff --git a/crates/openhuman-core/src/config/schemas/controllers/inference.rs b/crates/openhuman-core/src/config/schemas/controllers/inference.rs
index 498b9f0079..06962e24c2 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/inference.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/inference.rs
@@ -151,8 +151,6 @@ pub(super) fn handle_update_memory_settings(params: Map<String, Value>) -> Contr
Box::pin(async move {
let update = deserialize_params::<MemorySettingsUpdate>(params)?;
let patch = config_rpc::MemorySettingsPatch {
- backend: update.backend,
- auto_save: update.auto_save,
embedding_provider: update.embedding_provider,
embedding_model: update.embedding_model,
embedding_dimensions: update.embedding_dimensions,
diff --git a/crates/openhuman-core/src/config/schemas/controllers/registry.rs b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
index f2867c5ffc..57b909ecd4 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/registry.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
@@ -5,11 +5,11 @@ use crate::core::ControllerSchema;
use super::super::schema_defs::schemas;
use super::agent::{
- handle_get_agent_settings, handle_get_autonomy_settings, handle_get_memory_sync_settings,
+ handle_get_agent_settings, handle_get_autonomy_settings,
handle_get_privacy_mode, handle_get_sandbox_settings, handle_set_browser_allow_all,
handle_set_privacy_mode, handle_update_agent_settings, handle_update_autonomy_settings,
handle_update_browser_settings, handle_update_computer_settings,
- handle_update_memory_sync_settings, handle_update_sandbox_settings,
+ handle_update_sandbox_settings,
};
use super::inference::{
handle_get_client_config, handle_get_config, handle_get_runtime_flags, handle_resolve_api_url,
@@ -71,8 +71,6 @@ pub fn all_controller_schemas() -> Vec<ControllerSchema> {
schemas("update_agent_settings"),
schemas("update_search_settings"),
schemas("get_search_settings"),
- schemas("get_memory_sync_settings"),
- schemas("update_memory_sync_settings"),
schemas("get_sandbox_settings"),
schemas("update_sandbox_settings"),
]
@@ -228,14 +226,6 @@ pub fn all_registered_controllers() -> Vec<RegisteredController> {
schema: schemas("get_search_settings"),
handler: handle_get_search_settings,
},
- RegisteredController {
- schema: schemas("get_memory_sync_settings"),
- handler: handle_get_memory_sync_settings,
- },
- RegisteredController {
- schema: schemas("update_memory_sync_settings"),
- handler: handle_update_memory_sync_settings,
- },
RegisteredController {
schema: schemas("get_sandbox_settings"),
handler: handle_get_sandbox_settings,
diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs
index 867c9a3e1c..36251a39b3 100644
--- a/crates/openhuman-core/src/config/schemas/helpers.rs
+++ b/crates/openhuman-core/src/config/schemas/helpers.rs
@@ -74,8 +74,6 @@ pub(super) struct ModelSettingsUpdate {
#[derive(Debug, Deserialize)]
pub(super) struct MemorySettingsUpdate {
- pub(super) backend: Option<String>,
- pub(super) auto_save: Option<bool>,
pub(super) embedding_provider: Option<String>,
pub(super) embedding_model: Option<String>,
pub(super) embedding_dimensions: Option<usize>,
@@ -248,11 +246,6 @@ pub(super) struct AgentPathsUpdate {
pub(super) files_dir: Option<String>,
}
-#[derive(Debug, Deserialize)]
-pub(super) struct MemorySyncSettingsUpdate {
- pub(super) sync_interval_secs: Option<u64>,
-}
-
#[derive(Debug, Deserialize)]
pub(super) struct SandboxSettingsUpdate {
pub(super) backend: Option<String>,
diff --git a/crates/openhuman-core/src/config/schemas/mod.rs b/crates/openhuman-core/src/config/schemas/mod.rs
index 7a14781bc2..f7eb9ea299 100644
--- a/crates/openhuman-core/src/config/schemas/mod.rs
+++ b/crates/openhuman-core/src/config/schemas/mod.rs
@@ -32,8 +32,7 @@
//! `get_composio_trigger_settings`, `get_autonomy_settings`,
//! `update_autonomy_settings`, `get_privacy_mode`, `set_privacy_mode`,
//! `get_agent_settings`, `update_agent_settings`, `update_search_settings`,
-//! `get_search_settings`, `get_memory_sync_settings`,
-//! `update_memory_sync_settings`, `get_sandbox_settings`,
+//! `get_search_settings`, `get_sandbox_settings`,
//! `update_sandbox_settings`.
mod controllers;
diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs b/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs
index 87d8e87b63..888c4ef84a 100644
--- a/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs
+++ b/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs
@@ -163,25 +163,6 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {
required: true,
}],
}),
-"get_memory_sync_settings" => Some( ControllerSchema {
- namespace: "config",
- function: "get_memory_sync_settings",
- description: "Get the global memory-sync cadence applied to all opted-in sources: stored value, resolved selected cadence, manual/default flags, the 24h default, and the preset options (4h/12h/24h).",
- inputs: vec![],
- outputs: vec![json_output("settings", "Memory sync schedule settings.")],
- }),
-"update_memory_sync_settings" => Some( ControllerSchema {
- namespace: "config",
- function: "update_memory_sync_settings",
- description: "Set the global memory-sync cadence. Omit/null resets to the default; 0 means Manual only (auto-sync disabled); a positive value is seconds between syncs. Takes effect on the next scheduler tick.",
- inputs: vec![FieldSchema {
- name: "sync_interval_secs",
- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),
- comment: "Seconds between auto-syncs. null = default (24h); 0 = Manual only; n>0 = sync every n seconds.",
- required: false,
- }],
- outputs: vec![json_output("settings", "Updated memory sync schedule settings.")],
- }),
"get_sandbox_settings" => Some( ControllerSchema {
namespace: "config",
function: "get_sandbox_settings",
diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/inference.rs b/crates/openhuman-core/src/config/schemas/schema_defs/inference.rs
index 76220189b8..b53f3843b2 100644
--- a/crates/openhuman-core/src/config/schemas/schema_defs/inference.rs
+++ b/crates/openhuman-core/src/config/schemas/schema_defs/inference.rs
@@ -104,15 +104,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {
"update_memory_settings" => Some( ControllerSchema {
namespace: "config",
function: "update_memory_settings",
- description: "Update memory backend and embedding settings.",
+ description: "Update the embedding settings and the agent's memory-context window.",
inputs: vec![
- optional_string("backend", "Memory backend identifier."),
- FieldSchema {
- name: "auto_save",
- ty: TypeSchema::Option(Box::new(TypeSchema::Bool)),
- comment: "Enable auto-save.",
- required: false,
- },
optional_string("embedding_provider", "Embedding provider identifier."),
optional_string("embedding_model", "Embedding model identifier."),
FieldSchema {