Skip to content

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

refactor(modules): remove tinymemory module and its host integration

Steven Enamakel5c22db106954
diff --git a/crates/openhuman-core/src/modules/boot.rs b/crates/openhuman-core/src/modules/boot.rs
index bd326d5813..c3c655f742 100644
--- a/crates/openhuman-core/src/modules/boot.rs
+++ b/crates/openhuman-core/src/modules/boot.rs
@@ -24,7 +24,6 @@ use crate::config::Config;
/// unavailable, and the feature says so at the point of use. Taking the core
/// down because an optional codec is missing would be a worse trade.
pub async fn load_declared_modules(config: &Config) {
- super::memory::set_modules_policy(std::sync::Arc::new(config.clone()));
if !config.modules.enabled {
log::debug!("[modules] boot load skipped: modules are disabled in configuration");
return;
@@ -58,68 +57,14 @@ pub async fn load_declared_modules(config: &Config) {
if record.load != LoadPolicy::Eager {
continue;
}
- if !should_eager_load(record, config) {
- log::debug!(
- "[modules] eager module '{}' skipped: the memory driver is not module-backed",
- record.id
- );
- continue;
- }
- // TinyMemory resolves its embedding provider while the library is
- // admitted, through callbacks this host serves on the module bus. The
- // lazy path installs them before loading; the eager path must too, or
- // the module comes up without an embedder and every memory write fails
- // from then on.
- if record.id == super::memory::MODULE_ID {
- if let Err(reason) =
- super::memory::install_host_callbacks(std::sync::Arc::new(config.clone())).await
- {
- log::warn!(
- "[modules] eager module '{}' skipped: host callbacks are unavailable: {reason}",
- record.id
- );
- continue;
- }
- }
log::info!("[modules] eager module '{}' resolving at boot", record.id);
if let Err(reason) = ops::ensure_loaded(config, record.id).await {
log::warn!(
"[modules] eager module '{}' did not load: {reason}",
record.id
);
- continue;
}
- // The first retrieval after boot pays the Python server start, the
- // model load and the embedder's first connection — several seconds the
- // user's first question would otherwise wait on, or lose its memory
- // block to. Pay it now, off the request path (#6040).
- if record.id == super::memory::MODULE_ID {
- crate::memory::auto_recall::warm::spawn_at_boot(std::sync::Arc::new(config.clone()));
- }
- }
-}
-
-/// Whether `record` should be loaded eagerly at boot, given `config`.
-///
-/// Every `LoadPolicy::Eager` record is eager unconditionally, except
-/// TinyMemory: it is eager only when this host's memory subsystem actually
-/// selected the module-backed driver. Eager-loading it for every
-/// `modules.enabled` host — regardless of which memory driver is bound —
-/// would mean a host on the (default) `Embedded` driver pays a startup
-/// download and native `dlopen` for a module it never binds, breaking the
-/// module driver's opt-in contract.
-///
-/// [`crate::memory::binding::admit`] is the same pure,
-/// side-effect-free check `memory::binding::build` itself uses to decide what
-/// actually gets bound, so this can never disagree with the real binding.
-fn should_eager_load(record: &super::types::ModuleRecord, config: &Config) -> bool {
- if record.id != super::memory::MODULE_ID {
- return true;
}
- matches!(
- crate::memory::binding::admit(&config.subsystems.memory),
- Ok((_, crate::core::subsystem::DriverClass::Module))
- )
}
#[cfg(test)]
diff --git a/crates/openhuman-core/src/modules/host.rs b/crates/openhuman-core/src/modules/host.rs
index 3c9719b80e..cf4eb05ab2 100644
--- a/crates/openhuman-core/src/modules/host.rs
+++ b/crates/openhuman-core/src/modules/host.rs
@@ -186,9 +186,6 @@ async fn build_runtime() -> tinybus::Result<ModuleRuntime> {
let host = ModuleHost::new(broker);
let connection = Connection::connect(transport.connect().await?).await?;
- if let Some(config) = super::memory::policy().cloned() {
- super::memory_host::install(&connection, Arc::clone(&config)).await?;
- }
super::tokenjuice_host::install(&connection).await?;
Ok(ModuleRuntime {
diff --git a/crates/openhuman-core/src/modules/ops.rs b/crates/openhuman-core/src/modules/ops.rs
index e7ee6d0ef3..66a0551358 100644
--- a/crates/openhuman-core/src/modules/ops.rs
+++ b/crates/openhuman-core/src/modules/ops.rs
@@ -405,61 +405,7 @@ fn module_config(config: &Config, id: &str) -> serde_json::Value {
serde_json::json!({})
});
}
- if id != super::memory::MODULE_ID {
- return serde_json::json!({});
- }
- serde_json::json!({
- "workspace_dir": config.workspace_dir,
- // The registry file the host writes `[[memory_sources]]` into. The
- // module used to derive `workspace_dir/config.toml`, a file that does
- // not exist, and answered `NotFound` for every host-registered source
- // on sync (openhuman#5820). Additive: an older module ignores it.
- "config_path": config.config_path,
- "memory": config.memory,
- "memory_tree": config.memory_tree,
- "scheduler_gate": config.scheduler_gate,
- "local_ai": config.local_ai,
- "embeddings_provider": config.embeddings_provider,
- "memory_provider": config.memory_provider,
- "default_model": config.default_model,
- "default_temperature": config.default_temperature,
- "output_language": config.output_language,
- "memory_sources": config.memory_sources,
- "embedding_routes": config.embedding_routes,
- "storage_provider": config.storage.provider.config,
- "ollama_base_url": tinyinference_local::ollama::ollama_base_url_from_override(config.local_ai.base_url.as_deref()),
- // The module's `EmbeddingHost::default_cloud_embedding_model`: what the
- // engine switches to when the opted-in local model is unreachable
- // (`store::factories`). That is the host's managed-cloud default, the
- // same constant the in-process `OpenHumanEmbeddingHost` answers with.
- // It is NOT `config.memory.embedding_model`, which is the user's
- // intended model and is usually the local one; sending that here made
- // the cloud fallback ask the managed embedder for `nomic-embed-text`
- // (openhuman#5820).
- "cloud_embedding_model":
- tinyinference_embeddings::DEFAULT_CLOUD_MODEL,
- "cloud_embedding_dimensions":
- tinyinference_embeddings::DEFAULT_CLOUD_DIMENSIONS,
- "models_supporting_dimensions":
- tinyinference_embeddings::MODELS_SUPPORTING_DIMENSIONS,
- // The periodic composio and workspace-source sync loops run INSIDE the
- // module now (tinymemory#100), and these three are what let them run at
- // all. Without the cadence the module answers manual-only and skips
- // every source silently; without the mode `composio_config` never
- // selects its direct branch and every connection fails. All three are
- // `#[serde(default)]` upstream, so an older module ignores them rather
- // than failing to load.
- "memory_sync_interval_secs": config.memory_sync_interval_secs,
- "composio_mode": config.composio.mode,
- "composio_entity_id": config.composio.entity_id,
- // Proxied Composio addresses the backend with this; without it the module
- // builds its request against an empty base and fails in the HTTP client.
- // Empty (never `null`: the module's config field is a string) when no
- // backend transport is installed; proxied Composio then fails in the
- // HTTP client, which the module already reports per connection.
- "backend_api_url": crate::backend::base_url(&config.api_url).unwrap_or_default(),
- "driver_id": "tinymemory",
- })
+ serde_json::json!({})
}
/// A configured local artifact for `id`, if one is set.
@@ -476,12 +422,6 @@ fn local_override(config: &Config, id: &str) -> Option<PathBuf> {
.find_map(|entry| (entry.id == id).then(|| PathBuf::from(entry.path.clone())));
configured
- .or_else(|| {
- (id == super::memory::MODULE_ID)
- .then(|| std::env::var_os("TINYMEMORY_TEST_MODULE"))
- .flatten()
- .map(PathBuf::from)
- })
.or_else(|| {
(id == super::search::MODULE_ID)
.then(|| std::env::var_os("TINYSEARCH_TEST_MODULE"))
diff --git a/crates/openhuman-core/src/modules/registry.rs b/crates/openhuman-core/src/modules/registry.rs
index 7a96966183..a435308dba 100644
--- a/crates/openhuman-core/src/modules/registry.rs
+++ b/crates/openhuman-core/src/modules/registry.rs
@@ -38,7 +38,7 @@ mod records_computer;
mod records_docs_wallet;
mod records_extra;
mod records_mcp_connectors;
-mod records_memory_juice;
+mod records_juice;
mod records_runtime;
mod records_search;
mod records_voice;
@@ -48,7 +48,7 @@ use records_computer::TINYCOMPUTER;
use records_docs_wallet::{TINYDOCS, TINYWALLET};
use records_extra::{TINYBOX, TINYCHANNELS, TINYHOSTS};
use records_mcp_connectors::{TINYCONNECTORS, TINYMCP};
-use records_memory_juice::{TINYJUICE, TINYMEMORY};
+use records_juice::TINYJUICE;
use records_runtime::{TINYRUNTIME, TINYRUNTIME_NODEJS, TINYRUNTIME_PYTHON};
use records_search::TINYSEARCH;
use records_voice::TINYVOICE;
@@ -59,7 +59,6 @@ pub const ALL: &[ModuleRecord] = &[
TINYSEARCH,
TINYDOCS,
TINYWALLET,
- TINYMEMORY,
TINYJUICE,
TINYVOICE,
TINYRUNTIME,
diff --git a/crates/openhuman-core/src/modules/registry/records_juice.rs b/crates/openhuman-core/src/modules/registry/records_juice.rs
new file mode 100644
index 0000000000..dece4c5bd2
--- /dev/null
+++ b/crates/openhuman-core/src/modules/registry/records_juice.rs
@@ -0,0 +1,75 @@
+//! Registry record for the `tinyjuice` module.
+
+use crate::modules::types::{LoadPolicy, ModuleRecord, PlatformAsset};
+
+/// The `tinyjuice` content-aware tool-output compression engine.
+///
+/// Lazy because the host's compaction policy can disable it, and a session that
+/// never produces compressible tool output should not pay the download or
+/// resident native-library cost.
+pub(crate) const TINYJUICE: ModuleRecord = ModuleRecord {
+ id: "tinyjuice",
+ description: "Content-aware tool-output compression and recoverable caching",
+ bus_name: "ai.tinyhumans.tinyjuice.Compression",
+ object_path: "/ai/tinyhumans/tinyjuice/Compression",
+ version: "0.5.0",
+ release_url: "https://github.com/tinyhumansai/tinyjuice/releases/tag/v0.5.0",
+ assets: &[
+ PlatformAsset {
+ host_key: "ubuntu-24.04-x86_64",
+ archive: "tinyjuice-module-0.5.0-ubuntu-24.04-x86_64.tar.gz",
+ sha256: "1ea4b52fbf420724759190b047e44a1c28b78d7e0e6d890c32bff81fd0fee70f",
+ },
+ PlatformAsset {
+ host_key: "ubuntu-24.04-arm64",
+ archive: "tinyjuice-module-0.5.0-ubuntu-24.04-arm64.tar.gz",
+ sha256: "057b5e1cc4ff21592065ad7b367e535b10caebe9520b83cc6949d30a6256024f",
+ },
+ PlatformAsset {
+ host_key: "ubuntu-22.04-x86_64",
+ archive: "tinyjuice-module-0.5.0-ubuntu-22.04-x86_64.tar.gz",
+ sha256: "94c8998c830d9454560c00055187198a598eefaf5be51bcecdcd194a66f3b388",
+ },
+ PlatformAsset {
+ host_key: "ubuntu-22.04-arm64",
+ archive: "tinyjuice-module-0.5.0-ubuntu-22.04-arm64.tar.gz",
+ sha256: "7e1b47a96386e9df8185763abb296fc0b08d4bc943e45098370b00f0693902f6",
+ },
+ PlatformAsset {
+ host_key: "macos-26-arm64",
+ archive: "tinyjuice-module-0.5.0-macos-26-arm64.tar.gz",
+ sha256: "018de974d6846dac5916bb3bb4a7b8cde193515191efebcf4c92986d91e3c500",
+ },
+ PlatformAsset {
+ host_key: "macos-26-x86_64",
+ archive: "tinyjuice-module-0.5.0-macos-26-x86_64.tar.gz",
+ sha256: "27472f640931f64344deec69e6a9a94723790c10b17a01578dee9aec6bb1662d",
+ },
+ PlatformAsset {
+ host_key: "macos-15-arm64",
+ archive: "tinyjuice-module-0.5.0-macos-15-arm64.tar.gz",
+ sha256: "b4f6c367f61e7e4c33ad2241487ee443f838ea3a724170e497102c223fb13395",
+ },
+ PlatformAsset {
+ host_key: "macos-15-x86_64",
+ archive: "tinyjuice-module-0.5.0-macos-15-x86_64.tar.gz",
+ sha256: "35c6e8c94399ef7f9fd268022cc60d1a2bb9f2c79649d7a2204f8b8ce0cb5fc1",
+ },
+ PlatformAsset {
+ host_key: "windows-2025-x86_64",
+ archive: "tinyjuice-module-0.5.0-windows-2025-x86_64.zip",
+ sha256: "0806bd8741bda3b5510896261858d2bcca807710823ce51321cba55776923615",
+ },
+ PlatformAsset {
+ host_key: "windows-2022-x86_64",
+ archive: "tinyjuice-module-0.5.0-windows-2022-x86_64.zip",
+ sha256: "6ec4f6066b9bd082bc2eb57d3bef9dda06c5b50e8d10a1535042024fe09aae78",
+ },
+ PlatformAsset {
+ host_key: "windows-11-arm64",
+ archive: "tinyjuice-module-0.5.0-windows-11-arm64.zip",
+ sha256: "d609425636324061a27ac8763df70221a0d0d785ac90d403c8e4b1d3da1c2912",
+ },
+ ],
+ load: LoadPolicy::Lazy,
+};
diff --git a/crates/openhuman-core/src/modules/registry/records_memory_juice.rs b/crates/openhuman-core/src/modules/registry/records_memory_juice.rs
deleted file mode 100644
index c97fe0aea2..0000000000
--- a/crates/openhuman-core/src/modules/registry/records_memory_juice.rs
+++ /dev/null
@@ -1,150 +0,0 @@
-//! Registry records for the `tinymemory` and `tinyjuice` modules.
-
-use crate::modules::types::{LoadPolicy, ModuleRecord, PlatformAsset};
-
-/// The complete TinyMemory engine, loaded eagerly so its capabilities are
-/// available when the kernel assembles its RPC and tool surfaces.
-pub(crate) const TINYMEMORY: ModuleRecord = ModuleRecord {
- id: "tinymemory",
- description: "Local memory engine: store, ranked recall, and portable export",
- bus_name: "ai.tinyhumans.tinymemory.Memory",
- object_path: "/ai/tinyhumans/tinymemory/Memory",
- version: "1.22.2",
- release_url: "https://github.com/tinyhumansai/tinymemory/releases/tag/v1.22.2",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinymemory-module-1.22.2-ubuntu-24.04-x86_64.tar.gz",
- sha256: "6679043f32777c16fbc39e83ff5e537561c03af45f920982c59bd125675fb3a8",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinymemory-module-1.22.2-ubuntu-24.04-arm64.tar.gz",
- sha256: "86cce8cd940dc20ddb59aacee8ca42ea5d4e52718952cc2c44936baf7267de56",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinymemory-module-1.22.2-ubuntu-22.04-x86_64.tar.gz",
- sha256: "89f1da9f53e939263f3a7d9f4c6c19b52951bde308a9beb6efedc2b6c272163e",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinymemory-module-1.22.2-ubuntu-22.04-arm64.tar.gz",
- sha256: "14acb8a0e6d2733a00809f77a030522397593e0cd563ab07917370d0bf7a8a1b",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinymemory-module-1.22.2-macos-26-arm64.tar.gz",
- sha256: "c8461a88f8c85b5baeee3b4c1d46d7c086803976eee68e3f10ef3d6f9083fc73",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinymemory-module-1.22.2-macos-26-x86_64.tar.gz",
- sha256: "089c6248ef5065f31288a78b24f0d686bfbf48ad87770e68f6260d6b8d6337e5",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinymemory-module-1.22.2-macos-15-arm64.tar.gz",
- sha256: "bcabaf6e0709fc1ef2c4fa4750933ef6535fb37b792d6c55be9f682473faf815",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinymemory-module-1.22.2-macos-15-x86_64.tar.gz",
- sha256: "88eeb0fad76049555c92aee094716bb197cad72c9cceada41aa232dc746abb34",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinymemory-module-1.22.2-windows-2025-x86_64.zip",
- sha256: "1cc6a36e453a54f6e1efb539f99af63de806d35e8861a99486154f0742771e61",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinymemory-module-1.22.2-windows-2022-x86_64.zip",
- sha256: "e4f49910e2b56835121c28b1031740738839fb8aad115cf6dfd28c803c001788",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinymemory-module-1.22.2-windows-11-arm64.zip",
- sha256: "002caacf4659a400b51468dadfc374e75dd6f62f260790525d376ea4912f7101",
- },
- ],
- // Eager, unlike the two codecs above. A codec that is never asked for should
- // not be paid for, but a memory driver's absence changes what the kernel
- // offers rather than merely delaying it: capabilities are read at bind time
- // and the RPC surface and agent-tool list are filtered from them. Resolving
- // that during a user's first recall would mean the first recall is the one
- // that behaves differently.
- load: LoadPolicy::Eager,
-};
-
-/// The `tinyjuice` content-aware tool-output compression engine.
-///
-/// Lazy because the host's compaction policy can disable it, and a session that
-/// never produces compressible tool output should not pay the download or
-/// resident native-library cost.
-pub(crate) const TINYJUICE: ModuleRecord = ModuleRecord {
- id: "tinyjuice",
- description: "Content-aware tool-output compression and recoverable caching",
- bus_name: "ai.tinyhumans.tinyjuice.Compression",
- object_path: "/ai/tinyhumans/tinyjuice/Compression",
- version: "0.5.0",
- release_url: "https://github.com/tinyhumansai/tinyjuice/releases/tag/v0.5.0",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyjuice-module-0.5.0-ubuntu-24.04-x86_64.tar.gz",
- sha256: "1ea4b52fbf420724759190b047e44a1c28b78d7e0e6d890c32bff81fd0fee70f",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyjuice-module-0.5.0-ubuntu-24.04-arm64.tar.gz",
- sha256: "057b5e1cc4ff21592065ad7b367e535b10caebe9520b83cc6949d30a6256024f",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyjuice-module-0.5.0-ubuntu-22.04-x86_64.tar.gz",
- sha256: "94c8998c830d9454560c00055187198a598eefaf5be51bcecdcd194a66f3b388",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyjuice-module-0.5.0-ubuntu-22.04-arm64.tar.gz",
- sha256: "7e1b47a96386e9df8185763abb296fc0b08d4bc943e45098370b00f0693902f6",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyjuice-module-0.5.0-macos-26-arm64.tar.gz",
- sha256: "018de974d6846dac5916bb3bb4a7b8cde193515191efebcf4c92986d91e3c500",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyjuice-module-0.5.0-macos-26-x86_64.tar.gz",
- sha256: "27472f640931f64344deec69e6a9a94723790c10b17a01578dee9aec6bb1662d",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyjuice-module-0.5.0-macos-15-arm64.tar.gz",
- sha256: "b4f6c367f61e7e4c33ad2241487ee443f838ea3a724170e497102c223fb13395",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyjuice-module-0.5.0-macos-15-x86_64.tar.gz",
- sha256: "35c6e8c94399ef7f9fd268022cc60d1a2bb9f2c79649d7a2204f8b8ce0cb5fc1",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyjuice-module-0.5.0-windows-2025-x86_64.zip",
- sha256: "0806bd8741bda3b5510896261858d2bcca807710823ce51321cba55776923615",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyjuice-module-0.5.0-windows-2022-x86_64.zip",
- sha256: "6ec4f6066b9bd082bc2eb57d3bef9dda06c5b50e8d10a1535042024fe09aae78",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyjuice-module-0.5.0-windows-11-arm64.zip",
- sha256: "d609425636324061a27ac8763df70221a0d0d785ac90d403c8e4b1d3da1c2912",
- },
- ],
- load: LoadPolicy::Lazy,
-};