Skip to content

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

fix(subagent_sessions): read parent epoch from record doc

Steven Enamakela44d52835e0e
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port.rs
index e3cce04084..a68aa157bc 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port.rs
@@ -56,7 +56,7 @@ pub(crate) fn parent_epoch_from_sidecar(
Ok(repo
.get(&session_id)
.await?
- .map(|(record, _)| record.parent_epoch))
+ .map(|record| record.doc.parent_epoch))
})
.map_err(|error| SubagentError::Persistence(format!("read parent epoch: {error}")))
}
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
index 5f2975450c..5bc968181c 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
@@ -59,6 +59,19 @@ async fn driver_store_imports_legacy_rows_without_losing_host_epoch() {
let retained = legacy.load().unwrap();
assert_eq!(retained[0].parent_epoch, Some(7));
+ let context = dispatch.resolved().unwrap();
+ let documents = crate::core::runtime::CoreContext::sync_scope(context, || {
+ crate::storage::local::open("subagent_sessions", &workspace)
+ .unwrap()
+ .scoped()
+ .unwrap()
+ .documents()
+ .clone()
+ });
+ assert_eq!(
+ parent_epoch_from_sidecar(documents, "legacy-session".into()).unwrap(),
+ Some(7)
+ );
}
#[tokio::test]