Skip to content

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

chore(modules): remove unused module declarations

Steven Enamakel474e76ba733e
diff --git a/crates/openhuman-core/src/modules/channel_runtime.rs b/crates/openhuman-core/src/modules/channel_runtime.rs
index 9b8b332832..e247d5149f 100644
--- a/crates/openhuman-core/src/modules/channel_runtime.rs
+++ b/crates/openhuman-core/src/modules/channel_runtime.rs
@@ -22,7 +22,7 @@ struct LeaseState {
object: ModuleObjectClient,
cleanup: Cleanup,
closing: Mutex<Option<tokio::task::JoinHandle<Result<(), ModuleCallError>>>>,
- runtime: &'static super::host::ModuleRuntime,
+ runtime: &'static tinybus::module::ModuleRuntime,
}
#[derive(Clone)]
@@ -95,7 +95,7 @@ impl ChannelRuntimeLease {
.call_confidential("tinychannels", methods::RESERVE_RUNTIME, ())
.await?;
validate_reservation(&reservation)?;
- let runtime = super::host::runtime()
+ let runtime = super::runtime::runtime()
.await
.map_err(|_| ModuleCallError::TransportFailed)?;
let (sender, receiver) = tokio::sync::oneshot::channel();
@@ -114,7 +114,7 @@ impl ChannelRuntimeLease {
client: ModuleClient,
reservation: ChannelRuntimeReservation,
callback: impl tinybus::service::Interface,
- runtime: &'static super::host::ModuleRuntime,
+ runtime: &'static tinybus::module::ModuleRuntime,
) -> Result<Self, ModuleCallError> {
let callback_path = ObjectPath::new(&reservation.host_object_path)
.map_err(|_| ModuleCallError::ModuleFault)?;
@@ -200,7 +200,7 @@ async fn join_cleanup(
fn runtime_transport(
client: &ModuleClient,
- runtime: &'static super::host::ModuleRuntime,
+ runtime: &'static tinybus::module::ModuleRuntime,
) -> Result<(Connection, Proxy), ModuleCallError> {
#[cfg(test)]
if let Some(proxy) = client.fixture_proxy() {
diff --git a/crates/openhuman-core/src/modules/connectors.rs b/crates/openhuman-core/src/modules/connectors.rs
index 724a83db9b..9e212a606a 100644
--- a/crates/openhuman-core/src/modules/connectors.rs
+++ b/crates/openhuman-core/src/modules/connectors.rs
@@ -320,7 +320,7 @@ pub async fn proxy(config: &Config) -> Result<Proxy, String> {
async fn proxy_to_serving() -> Result<Proxy, String> {
let record =
registry::find(MODULE_ID).ok_or_else(|| format!("unknown module '{MODULE_ID}'"))?;
- let runtime = super::host::runtime().await.map_err(|_| {
+ let runtime = super::runtime::runtime().await.map_err(|_| {
super::failure::report(record, super::failure::Reason::TransportFailed);
tinybus::module::ModuleCallError::TransportFailed.to_string()
})?;
diff --git a/crates/openhuman-core/src/modules/desktop.rs b/crates/openhuman-core/src/modules/desktop.rs
index b0b4330d86..516f75858e 100644
--- a/crates/openhuman-core/src/modules/desktop.rs
+++ b/crates/openhuman-core/src/modules/desktop.rs
@@ -41,8 +41,8 @@ pub(crate) async fn proxy(config: &Config) -> Result<Proxy, String> {
Some(std::time::Duration::from_secs(8)),
)
.await
- .map_err(crate::modules::ops::LoadError::into_message)?;
- let runtime = crate::modules::host::runtime()
+ .map_err(crate::modules::ops::load_error_message)?;
+ let runtime = crate::modules::runtime::runtime()
.await
.map_err(|error| format!("TinyComputer module bus unavailable: {error}"))?;
crate::modules::registry::find(MODULE_ID)
diff --git a/crates/openhuman-core/src/modules/mod.rs b/crates/openhuman-core/src/modules/mod.rs
index 4974f44dc5..f55ef8c5d3 100644
--- a/crates/openhuman-core/src/modules/mod.rs
+++ b/crates/openhuman-core/src/modules/mod.rs
@@ -36,8 +36,11 @@
//! - [`wallet`] — the host half of the `tinywallet` module, which builds and
//! assembles transactions while the signing key stays in this process.
//! - [`linked`] — the registry of modules linked into the executable (local development).
-//! - [`host`] — the module broker, connection and loader.
-//! - [`ops`] — resolving, loading, and reporting status.
+//! - [`runtime`] — the process-wide `tinybus::module::ModuleRuntime` and the host
+//! callbacks served on its bus.
+//! - [`ops`] — the adapter over `tinybus::module::Resolver` and `ModuleClient`:
+//! builds them from [`Config`](crate::config::Config) and the registry.
+//! - [`report`] — the Sentry sink for terminal module outcomes.
//! - [`schemas`] — the `modules` RPC surface.
//! - [`boot`] — what happens at startup.
@@ -55,7 +58,6 @@ pub(crate) mod channel_controller;
pub(crate) mod channel_health;
#[cfg(all(feature = "channels", feature = "modules"))]
pub(crate) mod channel_runtime;
-pub mod client;
#[cfg(feature = "modules")]
pub mod computer;
#[cfg(feature = "modules")]
@@ -67,9 +69,6 @@ pub mod desktop;
#[cfg(feature = "documents")]
#[cfg(feature = "modules")]
pub mod documents;
-mod failure;
-#[cfg(feature = "modules")]
-pub mod host;
#[cfg(feature = "modules")]
pub mod linked;
#[cfg(feature = "modules")]
@@ -78,6 +77,10 @@ pub mod ops;
pub(crate) mod profile_claim;
pub mod registry;
#[cfg(feature = "modules")]
+pub(crate) mod report;
+#[cfg(feature = "modules")]
+pub mod runtime;
+#[cfg(feature = "modules")]
pub mod schemas;
#[cfg(feature = "modules")]
pub mod search;
@@ -137,7 +140,7 @@ pub(crate) mod web3_service;
pub(crate) mod x402_service;
#[cfg(feature = "modules")]
-pub use ops::{ensure_loaded, ensure_loaded_within, state_of, LoadError};
+pub use ops::{ensure_loaded, ensure_loaded_within, state_of};
#[cfg(feature = "modules")]
pub use schemas::{all_controller_schemas, all_registered_controllers};
#[doc(hidden)]
diff --git a/crates/openhuman-core/src/modules/ops_tests.rs b/crates/openhuman-core/src/modules/ops_tests.rs
index 225175b553..e94680e756 100644
--- a/crates/openhuman-core/src/modules/ops_tests.rs
+++ b/crates/openhuman-core/src/modules/ops_tests.rs
@@ -58,7 +58,7 @@ async fn invalid_installer_bundle_is_reported_without_falling_back_to_the_cache(
std::fs::create_dir_all(&bundle_dir).unwrap();
std::fs::write(bundle_dir.join(record.assets[0].archive), b"").unwrap();
- let runtime = crate::modules::host::runtime().await.unwrap();
+ let runtime = crate::modules::runtime::runtime().await.unwrap();
let error = ops::load_cached(
runtime,
record,
@@ -79,7 +79,7 @@ async fn absent_installer_bundle_uses_the_existing_cache_miss_path() {
let record = test_bundled_record();
let bundled = tempfile::tempdir().unwrap();
let user_cache = tempfile::tempdir().unwrap();
- let runtime = crate::modules::host::runtime().await.unwrap();
+ let runtime = crate::modules::runtime::runtime().await.unwrap();
let error = ops::load_cached(
runtime,
record,
@@ -624,7 +624,7 @@ async fn a_registered_linked_factory_serves_the_module_and_status_says_so() {
#[tokio::test]
async fn attaching_a_linked_module_without_a_factory_fails_with_a_static_reason() {
- let runtime = crate::modules::host::runtime().await.expect("module host");
+ let runtime = crate::modules::runtime::runtime().await.expect("module host");
let error = ops::load_linked(runtime, "tinyhosts-no-factory", serde_json::json!({}))
.expect_err("no factory is registered for this id");
assert!(error.contains("no linked factory"), "{error}");
@@ -637,7 +637,7 @@ async fn a_failing_linked_factory_is_reported_without_its_error_detail() {
Err(tinybus::Error::failed("secret-token /home/user/path"))
}
crate::modules::linked::register_linked("linked-failing-test", failing);
- let runtime = crate::modules::host::runtime().await.expect("module host");
+ let runtime = crate::modules::runtime::runtime().await.expect("module host");
let error = ops::load_linked(runtime, "linked-failing-test", serde_json::json!({}))
.expect_err("the factory fails");
assert!(
diff --git a/crates/openhuman-core/src/modules/search/proxy.rs b/crates/openhuman-core/src/modules/search/proxy.rs
index 3932ca3a3b..56f4eac5db 100644
--- a/crates/openhuman-core/src/modules/search/proxy.rs
+++ b/crates/openhuman-core/src/modules/search/proxy.rs
@@ -97,8 +97,8 @@ async fn proxy(config: &Config) -> Result<tinybus::Proxy, String> {
Some(std::time::Duration::from_secs(8)),
)
.await
- .map_err(crate::modules::ops::LoadError::into_message)?;
- let runtime = crate::modules::host::runtime()
+ .map_err(crate::modules::ops::load_error_message)?;
+ let runtime = crate::modules::runtime::runtime()
.await
.map_err(|error| format!("search module bus unavailable: {error}"))?;
let configuration =
@@ -121,7 +121,7 @@ async fn proxy(config: &Config) -> Result<tinybus::Proxy, String> {
/// Reinitialize, waiting out a module that is still finishing its previous
/// (re)initialization instead of failing the caller's search.
async fn reinitialize(
- runtime: &crate::modules::host::ModuleRuntime,
+ runtime: &tinybus::module::ModuleRuntime,
configuration: serde_json::Value,
) -> Result<(), String> {
const ATTEMPTS: u32 = 40;
diff --git a/crates/openhuman-core/src/tinymemes/service.rs b/crates/openhuman-core/src/tinymemes/service.rs
index 269ae4eef1..7dab866c0f 100644
--- a/crates/openhuman-core/src/tinymemes/service.rs
+++ b/crates/openhuman-core/src/tinymemes/service.rs
@@ -129,7 +129,7 @@ pub(crate) async fn remix(
return Err("the memes component is off".to_owned());
}
crate::modules::ensure_loaded(config, MODULE_ID).await?;
- let runtime = crate::modules::host::runtime()
+ let runtime = crate::modules::runtime::runtime()
.await
.map_err(|error| format!("the module bus is not running: {error}"))?;
let proxy = runtime