Skip to content

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

refactor(session_host): inline attachment staging into turn handling

Steven Enamakel01aeb0af41ea
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 ed593269d0..5d95312e77 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -5,8 +5,6 @@
//! prefix reconciliation, tool snapshots, resume and persistence remain inside
//! the runtime session.
-#[path = "runtime_session_attachment_input.rs"]
-mod attachment_input;
mod memory_ingest;
mod permanent;
mod post_commit;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_attachment_input.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_attachment_input.rs
deleted file mode 100644
index a7297bf67f..0000000000
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_attachment_input.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-use super::OpenHumanSessionHost;
-
-/// Stage direct user input against the exact runtime and workspace bound to
-/// this session. Library callers with no explicit origin retain their existing
-/// authorized attachment behavior.
-pub(super) async fn stage_turn(
- host: &OpenHumanSessionHost,
- message: &str,
- origin: Option<&crate::agent::turn_origin::AgentTurnOrigin>,
-) -> anyhow::Result<String> {
- crate::agent::attachments::stage_turn(
- message,
- host.runtime_config.as_deref(),
- host.workspace_descriptor.as_ref(),
- host.thread_id.as_deref(),
- origin,
- )
- .await
-}
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs
index ab37b2fe7b..26e8027098 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs
@@ -34,7 +34,14 @@ impl OpenHumanSessionHost {
self.host_env.core = crate::core::runtime::DispatchCtx::ambient().downgrade();
}
self.ensure_runtime_session()?;
- let staged = super::attachment_input::stage_turn(self, user_message, origin).await?;
+ let staged = crate::agent::attachments::stage_turn(
+ user_message,
+ self.runtime_config.as_deref(),
+ self.workspace_descriptor.as_ref(),
+ self.thread_id.as_deref(),
+ origin,
+ )
+ .await?;
let mut context = OpenHumanRunContext::new().with_host_env(&self.host_env);
context.untrusted_input_turn = self.untrusted_input;
context.origin = origin.cloned();