The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(scoring): address second-reviewer findings\n\nFour issues from the independent review pass on PR #5825.\n\n**runner.rs — entity guard polarity (blocking)**\nAll three non-success branches (extract_entities error, as_scoring() None,\nbinding unavailable) returned `false`, meaning `entities_empty = false` →\nthe fast path ran regardless of whether grounding was verified. This inverted\nthe relevance guard: any failure silently bypassed the #4677 optimisation\ngating logic. The pre-scoring behaviour was fail-safe — an unavailable\nextractor returned empty entities → `entities_empty = true` → fast path\nskipped. The bus-based path must preserve that contract: all error branches\nnow return `true` (defer to model walk). Also removed the unreachable\nARTIFACT_CAPABILITIES branch in the None arm; since Scoring is in the pinned\nconstant, `as_scoring()` never returns None for ModuleMemoryProvider, making\nthe warn! dead code that checked a constant against itself.\n\n**archivist_tests.rs — defanged negative tests**\nBoth `embed_segment_recap_skips_empty_summary` and `…_whitespace_summary`\nused `seg::segment_embedding_get(&conn, segment_id, "any-model")`. That\nfunction queries `WHERE segment_id = ? AND model_signature = ?` — "any-model"\nnever matches a real write (slug used is the configured model signature), so\nthe `row.is_none()` assertion was always vacuously true and could not detect\na regression. Replaced with `RecordingProvider` + assert `scoring.embed_text`\nabsent from calls: the actual invariant is that the guard fires before the\nscoring path, not merely that a DB row with the wrong key is missing.\n\n**archivist_tests.rs — non-interpolating .expect()**\n`.expect("…; got {methods:?}")` — curly braces are not interpolated in a\nstring literal, so a failure would have printed the literal text rather than\nthe method list. Changed to `.unwrap_or_else(|| panic!("…; got {methods:?}"))`.\n\n**driver_tests.rs — stale version comment**\nComment said "v1.13.1 adding Scoring". v1.13.1 was released 95 minutes before\nPR #110 (which added scoring to tinymemory) merged; v1.13.2 is the first\nartifact to include it. Updated to v1.13.2.\n\n**inference/embeddings/rpc.rs — drift hazard explanation**\nAdded explicit comment explaining why `MemoryScoring::embedder_slug()` is not\nused here: `get_settings` is a sync config-reading handler; the bus call is\nasync and requires a running module binding. This function answers "what slug\nwill be used?" — a config-derived prediction that must work before the module\nloads.\n\n**Cargo.lock — tinymemory root workspace version**\nThe submodule was moved to v1.13.2 in a prior commit but the root Cargo.lock\nwas not regenerated. Updated to match.\n
shanu788a7ff4998c
diff --git a/src/openhuman/agent/harness/archivist_tests.rs b/src/openhuman/agent/harness/archivist_tests.rsindex 8de9f18efb..a0650a55fe 100644--- a/src/openhuman/agent/harness/archivist_tests.rs+++ b/src/openhuman/agent/harness/archivist_tests.rs@@ -1001,66 +1001,49 @@ async fn phase2_flush_also_triggers_tree_ingest_inner() {// `embed_segment_recap` directly to lock the guard against future// regressions where `summarize_entries` could return `""`.-/// An empty recap must short-circuit before any scoring call, and must not-/// write a row to `segment_embeddings`. The segment row itself remains intact.+/// An empty recap must short-circuit before any scoring call.+///+/// Uses `RecordingProvider` so we can assert that `scoring.embed_text` is+/// absent — confirming the guard fired before the scoring path, not merely+/// that no row landed in a DB queried with the wrong model_signature key.#[tokio::test]async fn embed_segment_recap_skips_empty_summary() {- let (_tmp, client, provider) = setup_provider();- let conn = client.profile_conn();- let hook = hook_with_stubs(provider.clone());-- let segment_id = "seg-empty-recap";- seg::segment_create(- &conn,- segment_id,- "session-x",- "global",- 1,- Some(0),- 1.0,- 1.0,- )- .unwrap();- seg::segment_close(&conn, segment_id, 2.0).unwrap();+ use crate::openhuman::memory::guard::test_support::RecordingProvider;+ let recording = Arc::new(RecordingProvider::new());+ let provider: Arc<dyn MemoryProvider> = recording.clone();+ let hook = hook_with_stubs(provider);- hook.embed_segment_recap(segment_id, "", 3.0).await;+ hook.embed_segment_recap("seg-empty-recap", "", 3.0).await;- let row = seg::segment_embedding_get(&conn, segment_id, "any-model").unwrap();+ let calls = recording.calls();+ let methods: Vec<&str> = calls.iter().map(|c| c.method.as_str()).collect();assert!(- row.is_none(),- "No embedding row should exist for an empty-recap segment"+ !methods.contains(&"scoring.embed_text"),+ "scoring.embed_text must not be called for an empty recap; got {methods:?}");}/// Whitespace-only recaps (newlines, tabs, spaces) must also short-circuit/// — the upstream provider rejects whitespace inputs the same way it/// rejects empty inputs (#13021).+///+/// Uses `RecordingProvider` so we can assert that `scoring.embed_text` is+/// absent — confirming the guard fired before the scoring path, not merely+/// that no row landed in a DB queried with the wrong model_signature key.#[tokio::test]async fn embed_segment_recap_skips_whitespace_summary() {- let (_tmp, client, provider) = setup_provider();- let conn = client.profile_conn();- let hook = hook_with_stubs(provider.clone());-- let segment_id = "seg-ws-recap";- seg::segment_create(- &conn,- segment_id,- "session-y",- "global",- 1,- Some(0),- 1.0,- 1.0,- )- .unwrap();- seg::segment_close(&conn, segment_id, 2.0).unwrap();+ use crate::openhuman::memory::guard::test_support::RecordingProvider;+ let recording = Arc::new(RecordingProvider::new());+ let provider: Arc<dyn MemoryProvider> = recording.clone();+ let hook = hook_with_stubs(provider);- hook.embed_segment_recap(segment_id, " \n\t ", 3.0).await;+ hook.embed_segment_recap("seg-ws-recap", " \n\t ", 3.0).await;- let row = seg::segment_embedding_get(&conn, segment_id, "any-model").unwrap();+ let calls = recording.calls();+ let methods: Vec<&str> = calls.iter().map(|c| c.method.as_str()).collect();assert!(- row.is_none(),- "No embedding row should exist for a whitespace-only recap segment"+ !methods.contains(&"scoring.embed_text"),+ "scoring.embed_text must not be called for a whitespace-only recap; got {methods:?}");}@@ -1083,7 +1066,7 @@ async fn embed_segment_recap_reaches_scoring_for_non_empty_summary() {let slug_pos = methods.iter().position(|&m| m == "scoring.embedder_slug")- .expect("scoring.embedder_slug must be called; got {methods:?}");+ .unwrap_or_else(|| panic!("scoring.embedder_slug must be called; got {methods:?}"));let embed_pos = methods.iter().position(|&m| m == "scoring.embed_text")diff --git a/src/openhuman/agent/harness/subagent_runner/ops/runner.rs b/src/openhuman/agent/harness/subagent_runner/ops/runner.rsindex 936f7e695b..f9188ddd76 100644--- a/src/openhuman/agent/harness/subagent_runner/ops/runner.rs+++ b/src/openhuman/agent/harness/subagent_runner/ops/runner.rs@@ -253,8 +253,11 @@ async fn try_deterministic_memory_retrieval(// model-driven tool call would have done.//// Extraction goes through the provider's scoring family so the host no longer- // calls `tinymemory_core::` directly. If the driver does not support scoring- // the guard is skipped (fail-open) and the fast path runs regardless.+ // calls `tinymemory_core::` directly. Any failure (binding unavailable,+ // scoring not exposed, extraction error) is fail-safe: treat as entities_empty+ // = true so the fast path is skipped and the model-driven walk runs instead.+ // This preserves the pre-scoring behavior where an unavailable extractor+ // returned empty entities, keeping the guard conservative.let entities_empty = match crate::openhuman::memory::binding::for_config(config) {Ok(binding) => match binding.provider().as_scoring() {Some(scoring) => match scoring.extract_entities(query).await {@@ -263,38 +266,26 @@ async fn try_deterministic_memory_retrieval(tracing::debug!(task_id = %task_id,error = %e,- "[subagent_runner] scoring extract_entities failed (non-fatal) — skipping entity guard"+ "[subagent_runner] scoring extract_entities failed (non-fatal) — deferring to model walk (#4677)");- false+ true}},None => {- use tinymemory_api::capabilities::Capability;- if crate::openhuman::modules::memory::ARTIFACT_CAPABILITIES- .contains(&Capability::Scoring)- {- tracing::warn!(- task_id = %task_id,- "[subagent_runner] driver does not expose scoring but the pinned \- artifact is expected to serve it — check module version; \- skipping entity guard"- );- } else {- tracing::debug!(- task_id = %task_id,- "[subagent_runner] driver does not support scoring — skipping entity guard"- );- }- false+ tracing::debug!(+ task_id = %task_id,+ "[subagent_runner] driver does not expose scoring (module not loaded or policy excluded) — deferring to model walk (#4677)"+ );+ true}},Err(e) => {tracing::debug!(task_id = %task_id,error = %e,- "[subagent_runner] memory binding unavailable (non-fatal) — skipping entity guard"+ "[subagent_runner] memory binding unavailable (non-fatal) — deferring to model walk (#4677)");- false+ true}};if entities_empty {diff --git a/src/openhuman/inference/embeddings/rpc.rs b/src/openhuman/inference/embeddings/rpc.rsindex c38629ba6f..ac5a51b9ba 100644--- a/src/openhuman/inference/embeddings/rpc.rs+++ b/src/openhuman/inference/embeddings/rpc.rs@@ -17,6 +17,15 @@ const LOG_PREFIX: &str = "[embeddings::rpc]";/// 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"`.