Skip to content

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

refactor(config): widen config_save_error to crate visibility

Steven Enamakel2b1e27ae3e32
diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rs
index 27b422e54c..ac56d78c59 100644
--- a/crates/openhuman-core/src/config/ops/mod.rs
+++ b/crates/openhuman-core/src/config/ops/mod.rs
@@ -9,7 +9,7 @@ mod search;
mod tool_dispatcher;
mod ui;
-pub(super) fn config_save_error(error: anyhow::Error) -> String {
+pub(crate) fn config_save_error(error: anyhow::Error) -> String {
let conflict = error.chain().any(|cause| {
cause
.downcast_ref::<tinystoragedrivers::StorageError>()
diff --git a/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs b/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
index 14802e2ded..ea9199d348 100644
--- a/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
@@ -334,6 +334,10 @@ async fn stale_document_config_snapshot_returns_conflict_instead_of_overwriting(
.find_map(|cause| cause.downcast_ref::<tinystoragedrivers::StorageError>())
.expect("CAS failure retains the typed storage error");
assert_eq!(storage_error.kind(), tinystoragedrivers::ErrorKind::Conflict);
+ let rpc_error = crate::config::ops::config_save_error(error);
+ let rpc_error = crate::core::StructuredRpcError::decode(&rpc_error)
+ .expect("config RPC boundary exposes a structured conflict");
+ assert_eq!(rpc_error.data.unwrap()["kind"], "ConfigConflict");
let loaded = Config::load_from_config_path(&path, &tmp.path().join("workspace"))
.await
.unwrap();