Skip to content

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

fix(memory): use `and_then` with `ok()` for category parsing

Steven Enamakelc3357e98c7d4
diff --git a/crates/openhuman-core/src/memory/ops/fallback.rs b/crates/openhuman-core/src/memory/ops/fallback.rs
index 68be7a57c7..17a21e218d 100644
--- a/crates/openhuman-core/src/memory/ops/fallback.rs
+++ b/crates/openhuman-core/src/memory/ops/fallback.rs
@@ -151,8 +151,8 @@ fn record_to_entry(record: crate::memory::api::provider::types::ExportRecord) ->
let category = payload
.get("category")
.and_then(Value::as_str)
- .map(|c| c.parse().unwrap_or_default())
- .unwrap_or_default();
+ .and_then(|c| c.parse().ok())
+ .unwrap_or(crate::memory::api::types::MemoryCategory::Core);
Some(MemoryEntry {
id: record.id,
key,