Skip to content

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

fix(storage): restore session import from legacy storage

Steven Enamakelb2cea384bd4b
diff --git a/crates/openhuman-core/src/storage/import/sessions.rs b/crates/openhuman-core/src/storage/import/sessions.rs
index 782debe704..d9d4e8dde3 100644
--- a/crates/openhuman-core/src/storage/import/sessions.rs
+++ b/crates/openhuman-core/src/storage/import/sessions.rs
@@ -147,10 +147,12 @@ fn known_agents() -> HashMap<String, String> {
}
/// The text a stem carries for agent `id`: `session_stem` of a probe session,
-/// without its session key.
+/// without its session key. A stem is `<key>.<agent>[.g<n>]`, each component
+/// sanitized (a `.` inside one becomes `-`) and followed by a digest, so the
+/// agent's component is what follows the first `.`.
fn agent_component(id: &str) -> Option<String> {
let stem = session_stem(&SessionRef::scoped("probe", id));
- stem.strip_prefix("probe.").map(str::to_owned)
+ stem.split_once('.').map(|(_, agent)| agent.to_owned())
}
/// The agent whose component `stem` carries, if it is one of `known`.