Skip to content

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

refactor(session_host): move turn workspace descriptor into host_tools

Steven Enamakelc13502f05c37
diff --git a/crates/openhuman-core/src/agent/session_host/builder/factory.rs b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
index c8a92efbb3..f39f31c78b 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/factory.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
@@ -2,6 +2,7 @@
//! `build_session_agent_inner` constructor.
use super::dispatcher::{resolve_dispatcher_kind, DispatcherKind};
+use super::host_tools::derive_turn_workspace_descriptor;
use super::should_synthesize_delegation_tools;
use crate::agent::harness::definition::{
AgentDefinitionRegistry, PromptSource, ToolScope, NO_TOOLS_SENTINEL,
@@ -985,20 +986,3 @@ pub(crate) fn provider_role_for_definition(
.flatten();
provider_role_for(master_hint.as_deref().or(default_model))
}
-
-fn derive_turn_workspace_descriptor() -> Option<tinytools::WorkspaceDescriptor> {
- let root = crate::agent::turn_workspace::current()?;
- if !root.is_dir() {
- tracing::warn!(
- root = %root.display(),
- "[turn_workspace] scoped root is not an existing directory — \
- falling back to the shared action_dir cwd for this turn"
- );
- return None;
- }
- tracing::debug!(
- root = %root.display(),
- "[turn_workspace] turn bound to the embedder's per-turn root as default cwd"
- );
- Some(tinytools::WorkspaceDescriptor::new(root).with_policy_id("turn-workspace"))
-}
diff --git a/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs b/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
index 2485b164db..5f138cc3fe 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
@@ -372,3 +372,21 @@ pub(super) fn tool_builder(
}
Ok(builder)
}
+
+/// Binds the embedder's per-turn root as the default cwd, when it exists.
+pub(super) fn derive_turn_workspace_descriptor() -> Option<tinytools::WorkspaceDescriptor> {
+ let root = crate::agent::turn_workspace::current()?;
+ if !root.is_dir() {
+ tracing::warn!(
+ root = %root.display(),
+ "[turn_workspace] scoped root is not an existing directory — \
+ falling back to the shared action_dir cwd for this turn"
+ );
+ return None;
+ }
+ tracing::debug!(
+ root = %root.display(),
+ "[turn_workspace] turn bound to the embedder's per-turn root as default cwd"
+ );
+ Some(tinytools::WorkspaceDescriptor::new(root).with_policy_id("turn-workspace"))
+}