Skip to content

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

fix(subagent_sessions): drop stale lifecycle keys on conversion

Steven Enamakel562d990054b4
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 0c2217197b..d482d667e9 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
@@ -31,7 +31,13 @@ impl OpenHumanTinySubagentSessionStore {
fn convert(&self, row: DurableSubagentSession) -> Result<TinySession, SubagentError> {
let lifecycle_key = match (row.lifecycle_key.clone(), row.current_task_id.as_deref()) {
- (Some(key), _) => Some(key),
+ (Some(key), Some(task_id))
+ if key.task_id == task_id
+ && key.thread_id.as_deref() == row.parent_thread_id.as_deref() =>
+ {
+ Some(key)
+ }
+ (Some(_), _) => None,
(None, Some(task_id)) => super::resolve_lifecycle_key(
&self.store,
&row.subagent_session_id,