Skip to content

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

fix(accessors): handle missing turn results gracefully

Steven Enamakelaf563f69f418
diff --git a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
index 75510f46eb..0568adc405 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
@@ -3,7 +3,6 @@
//! (which rebuilds the tool policy snapshot on every change).
use super::super::types::{OpenHumanSessionHost, SessionHostBuilder};
-use crate::memory::Memory;
use crate::tools::agent_policy::ToolPolicyEngine;
use std::collections::HashSet;
use std::sync::Arc;
@@ -126,11 +125,6 @@ impl OpenHumanSessionHost {
&self.tool_policy_session
}
- /// Borrow the agent's memory backing store as an `Arc`.
- pub fn memory_arc(&self) -> Arc<dyn Memory> {
- Arc::clone(&self.memory)
- }
-
/// The full host [`Config`](crate::config::Config) this session
/// was built with, when it was built through the factory.
///
diff --git a/crates/openhuman-core/src/agent/session_host/runtime/turn_results.rs b/crates/openhuman-core/src/agent/session_host/runtime/turn_results.rs
index c50057f21c..71908880c5 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime/turn_results.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime/turn_results.rs
@@ -1,5 +1,5 @@
-//! Read-out of the latest completed turn: usage totals, the iteration-cap
-//! flag, and the memory citations collected alongside the turn.
+//! Read-out of the latest completed turn: usage totals and the iteration-cap
+//! flag.
use super::super::types::OpenHumanSessionHost;
@@ -47,48 +47,4 @@ impl OpenHumanSessionHost {
.last_turn_hit_cap
}
- /// Drain and return memory citations collected for the latest completed turn.
- ///
- /// Async because collection runs concurrently with the turn rather than
- /// ahead of it (see `OpenHumanSessionHost::pending_citations`); this joins whatever is
- /// still in flight. By the time a caller asks, the model round-trip has
- /// already happened, so the recall has normally finished and this does not
- /// wait.
- pub async fn take_last_turn_citations(
- &mut self,
- ) -> Vec<crate::memory::agent::memory_loader::MemoryCitation> {
- let pending = self
- .runtime_state
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
- .pending_citations
- .take();
- if let Some(handle) = pending {
- match handle.await {
- Ok(citations) => {
- self.runtime_state
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
- .last_turn_citations = citations
- }
- // A panicked or aborted collection must not fail the turn — the
- // citations are decorative, the reply is not.
- Err(err) => {
- log::warn!("[agent_loop] citation task did not complete: {err}");
- self.runtime_state
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
- .last_turn_citations
- .clear();
- }
- }
- }
- std::mem::take(
- &mut self
- .runtime_state
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
- .last_turn_citations,
- )
- }
}