Skip to content

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

refactor(config): remove unused memory_tree_content_root and simplify embedder slug resolution

Steven Enamakel0a60208d980d
diff --git a/crates/openhuman-core/src/config/schema/types/resolvers.rs b/crates/openhuman-core/src/config/schema/types/resolvers.rs
index be48710185..d7bc0e0030 100644
--- a/crates/openhuman-core/src/config/schema/types/resolvers.rs
+++ b/crates/openhuman-core/src/config/schema/types/resolvers.rs
@@ -14,21 +14,6 @@ impl Config {
crate::config::resolve_files_dir(&self.files_dir_override)
}
- /// Resolve the root directory where chunk `.md` files are stored.
- ///
- /// Resolution order:
- /// 1. `memory_tree.content_dir` if `Some`.
- /// 2. Default: `<workspace_dir>/memory_tree/content/`.
- ///
- /// This is the only place in the codebase that should compute the content
- /// root — all code that needs the path should call this method.
- pub fn memory_tree_content_root(&self) -> PathBuf {
- self.memory_tree
- .content_dir
- .clone()
- .unwrap_or_else(|| self.workspace_dir.join("memory_tree").join("content"))
- }
-
/// Read the per-workload provider string and return the local model id
/// when the workload is routed to Ollama.
///
diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs
index d037eb2f0a..2221802015 100644
--- a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs
@@ -39,40 +39,17 @@ fn model_rejection_outcome(reject: ModelNotServed) -> Outcome<serde_json::Value>
/// Slug naming the embedder ingestion will actually use, resolved host-side
/// from the `Config` fields the resolution ladder reads.
///
-/// Mirrors `tinymemory_core::tree::score::embed::effective_embedder_slug` so
-/// `get_settings` no longer calls `tinymemory_core::` directly (#5560).
-///
-/// `MemoryScoring::embedder_slug()` is not used here for two reasons:
-/// (1) `get_settings` is a synchronous config-reading RPC handler and cannot
-/// await an async bus call; (2) this function answers "what slug will ingestion
-/// use?" — a config-derived prediction that must work even when the module is
-/// not loaded. The bus call would give the same answer when the module is
-/// running, but would fail gracefully when it is not, offering no benefit over
-/// reading the config directly. Keep both implementations in sync whenever the
-/// engine's resolution ladder changes.
-///
-/// Resolution order (matches the engine factory's ladder):
-/// 1. Explicit Ollama override — `memory_tree.embedding_endpoint` +
-/// `memory_tree.embedding_model` both `Some` and non-empty → `"ollama"`.
-/// 2. Deliberate opt-out — `embeddings_provider` trimmed equals `"none"` → `"none"`.
-/// 3. Local Ollama via unified workload setting — `workload_local_model("embeddings")`
+/// Resolution order:
+/// 1. Deliberate opt-out — `embeddings_provider` trimmed equals `"none"` → `"none"`.
+/// 2. Local Ollama via unified workload setting — `workload_local_model("embeddings")`
/// is `Some` → `"ollama"`.
-/// 4. User OpenAI-compatible endpoint — `memory.embedding_provider` is
+/// 3. User OpenAI-compatible endpoint — `memory.embedding_provider` is
/// `"openai"`, `"custom"`, or starts with `"custom:"` → `"custom"`.
-/// 5. Managed cloud session — `auth-profiles.json` exists next to the config
+/// 4. Managed cloud session — `auth-profiles.json` exists next to the config
/// file → `"cloud"`.
-/// 6. Nothing usable → `"unconfigured"`.
+/// 5. Nothing usable → `"unconfigured"`.
fn effective_embedder_slug_from_config(config: &Config) -> &'static str {
- // 1. Explicit Ollama override.
- if let (Some(ep), Some(model)) = (
- config.memory_tree.embedding_endpoint.as_deref(),
- config.memory_tree.embedding_model.as_deref(),
- ) {
- if !ep.trim().is_empty() && !model.trim().is_empty() {
- return "ollama";
- }
- }
- // 2. Deliberate opt-out.
+ // 1. Deliberate opt-out.
if config
.embeddings_provider
.as_deref()
@@ -81,16 +58,16 @@ fn effective_embedder_slug_from_config(config: &Config) -> &'static str {
{
return "none";
}
- // 3. Local Ollama via unified workload setting.
+ // 2. Local Ollama via unified workload setting.
if config.workload_local_model("embeddings").is_some() {
return "ollama";
}
- // 4. User OpenAI-compatible endpoint.
+ // 3. User OpenAI-compatible endpoint.
let picker = config.memory.embedding_provider.trim();
if picker == "openai" || picker == "custom" || picker.starts_with("custom:") {
return "custom";
}
- // 5. Managed cloud session.
+ // 4. Managed cloud session.
let session_exists = config
.config_path
.parent()
diff --git a/crates/openhuman-core/src/security/credentials/ops/user_scope.rs b/crates/openhuman-core/src/security/credentials/ops/user_scope.rs
index 4a4bf8ba0e..490f354827 100644
--- a/crates/openhuman-core/src/security/credentials/ops/user_scope.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/user_scope.rs
@@ -116,9 +116,8 @@ pub(super) async fn reload_config_or(_fallback: &Config) -> Result<Config, Strin
}
/// Point every process-global store at `config`'s workspace after a
-/// credential change: cron seeds, the core context (which carries the memory
-/// binding — see `CoreContext::memory_binding`, #5560), conversation
-/// persistence, and the process-global cost tracker. Returns log lines for
+/// credential change: cron seeds (including memory's cron jobs), the core
+/// context, conversation persistence, and the process-global cost tracker. Returns log lines for
/// the RPC outcome.
pub(super) fn rebind_after_credential_change(
config: &Config,