Skip to content

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

chore(session-host): tidy imports and formatting in runtime session

Steven Enamakel6e9f4a4be6be
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 c8b2e056a9..ec044f95ee 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -36,7 +36,10 @@ use crate::agent::{
session_host::{
driver::OpenHumanSessionDriver, OpenHumanSessionHooks, OpenHumanTranscriptCodec,
},
- tinyagents::{host::OpenHumanRunContext, middleware::turn_context::TurnContextMiddleware},
+ tinyagents::{
+ host::OpenHumanRunContext,
+ middleware::turn_context::{TranscriptSnapshotSink, TurnContextMiddleware},
+ },
};
#[path = "runtime_session_progress.rs"]
@@ -74,11 +77,7 @@ struct OpenHumanTurnPrelude {
/// Host prompt/utilisation state, shared by the runtime hooks. It is not
/// generic conversation state and the runtime never persists it.
context: Arc<std::sync::Mutex<crate::agent::context::ContextManager>>,
- tool_policy: Arc<
- dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
- >,
+ tool_policy: Arc<dyn tinyagents_harness::middleware::ToolCallPolicy<crate::agent::tinyagents::host::OpenHumanRunContext>>,
tool_dispatcher: Arc<dyn tinytools_agent::dialect::ToolDialect>,
workspace_dir: std::path::PathBuf,
action_dir: std::path::PathBuf,
@@ -282,7 +281,9 @@ impl OpenHumanTurnPrelude {
.filter(|spec| !withheld.contains(&spec.name))
.filter(|spec| {
self.thread_id.is_some()
- || !crate::agent::tinyagents::tool_registration::is_thread_goal_tool(&spec.name)
+ || !crate::agent::tinyagents::tool_registration::is_thread_goal_tool(
+ &spec.name,
+ )
})
.map(|spec| spec.as_ref().clone())
.collect::<Vec<_>>();
@@ -814,7 +815,7 @@ impl OpenHumanSessionHost {
+ usize::from(view.history.last() != Some(&request.input));
Box::pin(async move {
let transcript_snapshot =
- crate::agent::tinyagents::middleware::turn_context::TranscriptSnapshotSink::default();
+ TranscriptSnapshotSink::default();
transcript_snapshot
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)