Skip to content

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

fix(runtime_session): handle missing session state on resume

Steven Enamakel7d0db3a772d5
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index b57907b68e..d14157103a 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -1025,14 +1025,26 @@ impl OpenHumanSessionHost {
}
}
}
- let outcome = self
+ // Memory acts as this agent for the whole turn: what it learns lands
+ // on its node and what it recalls stays within its reach.
+ let default_config;
+ let memory_config = match self.runtime_config.as_deref() {
+ Some(config) => config,
+ None => {
+ default_config = crate::config::Config::default();
+ &default_config
+ }
+ };
+ let agent_id = self.agent_definition_id.clone();
+ let turn = self
.runtime_session
.as_mut()
.expect("runtime session initialized")
.turn(
SessionTurnRequest::new(user_message_from_text(user_message)),
options,
- )
+ );
+ let outcome = crate::memory::scope::within_agent(memory_config, &agent_id, turn)
.await
.map_err(|error| anyhow::anyhow!(error.to_string()))?;
Ok(outcome.output.unwrap_or_default())