Skip to content

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

refactor(memory): improve error handling in legacy channel loading

Steven Enamakelc8408607415e
diff --git a/crates/openhuman-core/src/memory/ops.rs b/crates/openhuman-core/src/memory/ops.rs
index 5fd33340df..6ab05b4c42 100644
--- a/crates/openhuman-core/src/memory/ops.rs
+++ b/crates/openhuman-core/src/memory/ops.rs
@@ -517,12 +517,11 @@ fn legacy_channel_threads(workspace: &Path, channel: &str) -> BTreeSet<String> {
let Ok(text) = std::fs::read_to_string(&file) else {
return BTreeSet::new();
};
- let all: BTreeMap<String, BTreeSet<String>> = serde_json::from_str(&text).unwrap_or_else(
- |error| {
+ let all: BTreeMap<String, BTreeSet<String>> =
+ serde_json::from_str(&text).unwrap_or_else(|error| {
tracing::warn!(%error, "[memory:channels] legacy channel map unparsable; skipped");
BTreeMap::new()
- },
- );
+ });
all.get(&channel_key(channel)).cloned().unwrap_or_default()
}