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
fix(config): surface storage conflicts as retryable errors
Steven Enamakel2cf4df3dfa77
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rsindex cc72ad87b3..affa7e9a38 100644--- a/crates/openhuman-core/src/config/ops/agent.rs+++ b/crates/openhuman-core/src/config/ops/agent.rs@@ -133,7 +133,7 @@ pub async fn apply_autonomy_settings(config.autonomy.auto_approve_all = auto_approve_all;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;crate::security::live_policy::reload_from(&config.autonomy);crate::core::bus::BUS.publish(crate::core::events::DomainEvent::AutonomyConfigChanged);@@ -248,7 +248,7 @@ pub async fn apply_agent_settings();}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let effective = crate::tools::timeout::set_tool_timeout_secs(config.agent.agent_timeout_secs);log::debug!(@@ -611,7 +611,7 @@ pub async fn apply_agent_paths_settings(config.action_dir = crate::config::resolve_action_dir(&config.action_dir_override);- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;crate::security::live_policy::set_action_dir(config.action_dir.clone());crate::core::bus::BUS.publish(crate::core::events::DomainEvent::AgentPathsChanged);@@ -643,7 +643,7 @@ pub async fn apply_agent_paths_settings(if previous != config.files_dir() && !config.files_dir_history.contains(&previous) {config.files_dir_history.push(previous);}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;crate::core::bus::BUS.publish(crate::core::events::DomainEvent::AgentPathsChanged);log::debug!("[config][agent_paths] files_dir now '{}'",diff --git a/crates/openhuman-core/src/config/ops/computer.rs b/crates/openhuman-core/src/config/ops/computer.rsindex eb30230037..44632aa135 100644--- a/crates/openhuman-core/src/config/ops/computer.rs+++ b/crates/openhuman-core/src/config/ops/computer.rs@@ -82,7 +82,7 @@ pub async fn apply_computer_settings(max_rescues = ?config.computer.max_rescues,"[config] computer settings updated");- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rsindex e1d71b4d79..27b422e54c 100644--- a/crates/openhuman-core/src/config/ops/mod.rs+++ b/crates/openhuman-core/src/config/ops/mod.rs@@ -9,6 +9,26 @@ mod search;mod tool_dispatcher;mod ui;+pub(super) fn config_save_error(error: anyhow::Error) -> String {+ let conflict = error.chain().any(|cause| {+ cause+ .downcast_ref::<tinystoragedrivers::StorageError>()+ .is_some_and(|error| error.kind() == tinystoragedrivers::ErrorKind::Conflict)+ });+ if conflict {+ return crate::core::StructuredRpcError {+ message: "Configuration changed on another instance; reload it and retry".into(),+ data: Some(serde_json::json!({+ "kind": "ConfigConflict",+ "retryable": true,+ })),+ expected_user_state: true,+ }+ .encode();+ }+ error.to_string()+}+// ── Public re-exports (preserving the flat external API) ─────────────────────pub use agent::redact_home;diff --git a/crates/openhuman-core/src/config/ops/model.rs b/crates/openhuman-core/src/config/ops/model.rsindex dfe467d345..2185b7e823 100644--- a/crates/openhuman-core/src/config/ops/model.rs+++ b/crates/openhuman-core/src/config/ops/model.rs@@ -428,7 +428,7 @@ pub async fn apply_model_settings(complete_byok_route(config, &explicit_role_pins);- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,@@ -474,7 +474,7 @@ pub async fn apply_memory_settings(if let Some(dimensions) = update.embedding_dimensions {config.memory.embedding_dimensions = dimensions;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,@@ -533,7 +533,7 @@ pub async fn apply_runtime_settings((None, effort) => config.runtime.reasoning_effort = effort,}}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,@@ -611,7 +611,7 @@ pub async fn apply_local_ai_settings(});}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,@@ -650,7 +650,7 @@ pub async fn apply_composio_trigger_settings();config.composio.triage_disabled_toolkits = toolkits;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,diff --git a/crates/openhuman-core/src/config/ops/privacy.rs b/crates/openhuman-core/src/config/ops/privacy.rsindex 7efa3ba1de..daeab025da 100644--- a/crates/openhuman-core/src/config/ops/privacy.rs+++ b/crates/openhuman-core/src/config/ops/privacy.rs@@ -69,7 +69,7 @@ pub async fn apply_privacy_settings(config.privacy.mode = mode;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;// Hot-swap the live policy so enforcement takes effect without a restart.// `Err` here just means no session runtime is installed yet (e.g. CLI) — thediff --git a/crates/openhuman-core/src/config/ops/sandbox.rs b/crates/openhuman-core/src/config/ops/sandbox.rsindex 73bcc08982..2d908ab084 100644--- a/crates/openhuman-core/src/config/ops/sandbox.rs+++ b/crates/openhuman-core/src/config/ops/sandbox.rs@@ -105,7 +105,7 @@ pub async fn apply_sandbox_settings();}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;log::debug!("[config][sandbox] sandbox settings saved to {}",diff --git a/crates/openhuman-core/src/config/ops/search.rs b/crates/openhuman-core/src/config/ops/search.rsindex ff66318a11..b971a43ada 100644--- a/crates/openhuman-core/src/config/ops/search.rs+++ b/crates/openhuman-core/src/config/ops/search.rs@@ -292,7 +292,7 @@ pub async fn apply_search_settings(update: SearchSettingsPatch,) -> Result<Outcome<Value>, String> {apply_search_patch(config, update)?;- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;#[cfg(feature = "modules")]crate::modules::search::refresh_loaded(ctx, config).await?;tracing::debug!(diff --git a/crates/openhuman-core/src/config/ops/ui.rs b/crates/openhuman-core/src/config/ops/ui.rsindex 7906f94c32..509d8589be 100644--- a/crates/openhuman-core/src/config/ops/ui.rs+++ b/crates/openhuman-core/src/config/ops/ui.rs@@ -123,7 +123,7 @@ pub async fn apply_browser_settings(browser.learn_from_tasks = learn;}config.browser = browser;- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;// Tools built before the switch hold the config they were built with.#[cfg(feature = "modules")]if let Some(learn) = update.learn_from_tasks {@@ -179,7 +179,7 @@ pub async fn apply_analytics_settings(if let Some(enabled) = update.enabled {config.observability.analytics_enabled = enabled;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(config)?;Ok(Outcome::new(snapshot,@@ -358,7 +358,7 @@ pub async fn set_onboarding_completed(let was_completed = config.onboarding_completed;config.onboarding_completed = value;- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;if value && !was_completed {tracing::debug!(@@ -439,7 +439,7 @@ pub async fn load_and_apply_dictation_settings(if let Some(interval) = update.streaming_interval_ms {config.dictation.streaming_interval_ms = interval;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(&config)?;Ok(Outcome::new(snapshot,@@ -527,7 +527,7 @@ pub async fn load_and_apply_voice_server_settings(})?;config.voice_server.stt_engine = parsed;}- config.save().await.map_err(|e| e.to_string())?;+ config.save().await.map_err(super::config_save_error)?;let snapshot = snapshot_config_json(&config)?;Ok(Outcome::new(snapshot,