Skip to content

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

refactor(agent): relocate worker thread and run mode modules

Steven Enamakel07bd19f21746
diff --git a/crates/openhuman-core/src/agent/orchestration/tools.rs b/crates/openhuman-core/src/agent/orchestration/tools.rs
index 57684c3366..a802725b9f 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools.rs
@@ -41,8 +41,6 @@ mod spawn_async_subagent;
mod spawn_parallel_agents;
#[path = "tools/spawn_subagent.rs"]
mod spawn_subagent;
-#[path = "tools/spawn_worker_thread.rs"]
-pub mod spawn_worker_thread;
#[path = "tools/steer_subagent.rs"]
mod steer_subagent;
#[path = "tools/subagent_abort_report.rs"]
@@ -52,8 +50,6 @@ mod subagent_abort_report;
mod tools_e2e_tests;
#[path = "tools/wait_subagent.rs"]
mod wait_subagent;
-#[path = "tools/worker_thread.rs"]
-mod worker_thread;
pub(crate) use dispatch::DelegationDispatch;
@@ -88,8 +84,6 @@ pub(crate) use spawn_parallel_agents::SpawnParallelAgentsDispatch;
pub use spawn_parallel_agents::SpawnParallelAgentsTool;
pub(crate) use spawn_subagent::SpawnSubagentDispatch;
pub use spawn_subagent::SpawnSubagentTool;
-pub(crate) use spawn_worker_thread::SpawnWorkerThreadDispatch;
-pub use spawn_worker_thread::SpawnWorkerThreadTool;
pub(crate) use steer_subagent::SteerSubagentDispatch;
pub use steer_subagent::SteerSubagentTool;
pub(crate) use wait_subagent::WaitSubagentDispatch;
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 7c3b307c2a..7bb2419512 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -5,6 +5,7 @@
//! prefix reconciliation, tool snapshots, resume and persistence remain inside
//! the runtime session.
+#[path = "../../../memory/lifecycle/session_hooks.rs"]
mod memory_ingest;
mod permanent;
mod post_commit;
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs
index 6ab8ba34cf..bcf7e263cc 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs
@@ -38,7 +38,6 @@
// spawn's worker thread.
mod dispatch;
mod transcript;
-mod worker_mirror;
// Re-exported under the original flat `graph::` path so external callers
// (`ops/mod.rs`, `ops/runner.rs`, `graph_tests.rs`'s `use super::*`) are
@@ -62,9 +61,6 @@ use std::sync::Arc;
use tinyagents_session::transcript::TranscriptMessage;
#[cfg(test)]
use tinyjuice_bus::types::AgentTokenjuiceCompression;
-#[cfg(test)]
-#[cfg(test)]
-use worker_mirror::{mirror_worker_thread, mirror_worker_thread_from_history};
#[cfg(test)]
#[path = "graph_tests.rs"]
diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rs
index 383912447f..fb9ab38f0e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs
@@ -32,7 +32,6 @@ pub(crate) mod live_harness;
mod memory_summarizer;
pub(crate) mod middleware;
pub(crate) mod observability;
-pub mod run_mode;
// `pub` since issue #6014, and the inconsistency it removes is the point:
// `AgentBuilder::payload_summarizer` is a **public** setter taking
// `Arc<DynPayloadSummarizer>`, so the seam was already advertised to embedders
diff --git a/crates/openhuman-core/src/threads/mod.rs b/crates/openhuman-core/src/threads/mod.rs
index 1adea2380c..2163ff9f65 100644
--- a/crates/openhuman-core/src/threads/mod.rs
+++ b/crates/openhuman-core/src/threads/mod.rs
@@ -7,6 +7,7 @@
pub mod artifact_rows;
pub mod error;
pub mod ops;
+pub(crate) mod run_mode;
pub mod rpc_models;
pub mod schemas;
pub mod store;
@@ -14,6 +15,8 @@ pub mod store;
mod transcript_host_tests;
pub mod turn_state;
pub mod welcome_migration;
+pub(crate) mod worker_mirror;
+pub(crate) mod worker_thread;
pub use error::{ThreadsError, THREAD_NOT_FOUND_KIND};
pub use rpc_models::*;
diff --git a/crates/openhuman-core/src/tools/impl/mod.rs b/crates/openhuman-core/src/tools/impl/mod.rs
index 5eea8196d3..8529ac0457 100644
--- a/crates/openhuman-core/src/tools/impl/mod.rs
+++ b/crates/openhuman-core/src/tools/impl/mod.rs
@@ -6,6 +6,7 @@ pub mod network;
#[cfg(feature = "documents")]
pub mod presentation;
pub mod system;
+pub mod threads;
pub use browser::*;
#[cfg(feature = "documents")]