Skip to content

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

fix(test): run agent_retrieval_e2e, and route it through the shipped ingest path\n\nTwo defects in one file. Both tests carried `#[ignore]`, so neither ran;\nand both ingested through `tinymemory_core::ingest_pipeline::{ingest_chat,\ningest_email}` — the in-process engine call that #5560/#5779 replaced —\nso if they had run they would have exercised a path the product no longer\ntakes.\n\nThey now go through `memory::tree::tree::rpc::ingest_rpc`, which is what\nthe `openhuman.memory_tree_ingest` RPC serves: payload -> `chat_items` /\n`email_items` -> the bound driver's Ingest family. The chunk listing moves\nto `read_rpc::list_chunks_rpc` for the same reason — reading the engine's\nin-process store directly would not be reading what the product reads.\n\nThe ignore reason ("the currently pinned artifact predates\nSearchEntities/RetrieveLeaves") no longer holds: all three tests pass\nagainst the pinned module.\n

M3gA-Mind7315daf8febb
diff --git a/tests/agent_retrieval_e2e.rs b/tests/agent_retrieval_e2e.rs
index 88c3c12c5c..34e239c497 100644
--- a/tests/agent_retrieval_e2e.rs
+++ b/tests/agent_retrieval_e2e.rs
@@ -21,6 +21,9 @@
use chrono::{TimeZone, Utc};
use openhuman_core::openhuman::config::Config;
+use openhuman_core::openhuman::memory::read_rpc::{self, ChunkFilter};
+use openhuman_core::openhuman::memory::tree::tree::canonicalize_types::IngestRequest;
+use openhuman_core::openhuman::memory::tree::tree::rpc::ingest_rpc;
use openhuman_core::openhuman::tools::{
MemoryTreeFetchLeavesTool, MemoryTreeSearchEntitiesTool, Tool,
};
@@ -28,7 +31,7 @@ use serde_json::{json, Value};
use tempfile::TempDir;
use tinycortex::memory::ingest::canonicalize::chat::{ChatBatch, ChatMessage};
use tinycortex::memory::ingest::canonicalize::email::{EmailMessage, EmailThread};
-use tinymemory_core::ingest_pipeline::{ingest_chat, ingest_email};
+use tinymemory_api::chunks::SourceKind;
use tinymemory_core::queue::drain_until_idle;
/// Install the host seams the memory subsystem needs.
@@ -241,9 +244,6 @@ fn orchestrator_reaches_memory_agent_on_demand() {
/// (issue#1505): the retrieval tool must be able to surface facts from a
/// channel the current conversation did not originate in.
#[tokio::test]
-#[ignore = "needs a released tinymemory module serving the Retrieval family: \
- the port routes these tools through the module driver, and the \
- currently pinned artifact predates SearchEntities/RetrieveLeaves"]
async fn cross_chat_entity_index_spans_source_boundaries() {
ensure_memory_seams();
let (tmp, cfg) = test_config();
@@ -261,9 +261,18 @@ async fn cross_chat_entity_index_spans_source_boundaries() {
source_ref: Some("slack://eng/1".into()),
}],
};
- ingest_chat(&cfg, "slack:#eng", "alice", vec![], chat_a)
- .await
- .expect("ingest chat A should succeed");
+ ingest_rpc(
+ &cfg,
+ IngestRequest {
+ source_kind: SourceKind::Chat,
+ source_id: "slack:#eng".into(),
+ owner: "alice".into(),
+ tags: vec![],
+ payload: serde_json::to_value(chat_a).expect("chat batch serialises"),
+ },
+ )
+ .await
+ .expect("ingest chat A should succeed");
// Chat B — a separate channel with no overlap with chat A
let chat_b = ChatBatch {
@@ -276,9 +285,18 @@ async fn cross_chat_entity_index_spans_source_boundaries() {
source_ref: Some("slack://ops/1".into()),
}],
};
- ingest_chat(&cfg, "slack:#ops", "carol", vec![], chat_b)
- .await
- .expect("ingest chat B should succeed");
+ ingest_rpc(
+ &cfg,
+ IngestRequest {
+ source_kind: SourceKind::Chat,
+ source_id: "slack:#ops".into(),
+ owner: "carol".into(),
+ tags: vec![],
+ payload: serde_json::to_value(chat_b).expect("chat batch serialises"),
+ },
+ )
+ .await
+ .expect("ingest chat B should succeed");
drain_until_idle(&cfg)
.await
@@ -356,61 +374,64 @@ async fn cross_chat_entity_index_spans_source_boundaries() {
/// fetch_leaves and each returned leaf must carry `source_ref` when one was
/// set at ingest time.
#[tokio::test]
-#[ignore = "needs a released tinymemory module serving the Retrieval family: \
- the port routes these tools through the module driver, and the \
- currently pinned artifact predates SearchEntities/RetrieveLeaves"]
async fn fetch_leaves_hydrates_source_ref_for_cited_chunks() {
ensure_memory_seams();
let (tmp, cfg) = test_config();
// Ingest an email thread with explicit source_refs on every message.
- ingest_email(
+ ingest_rpc(
&cfg,
- "gmail:thread-provenance-1",
- "alice",
- vec![],
- EmailThread {
- provider: "gmail".into(),
- thread_subject: "Q3 roadmap decision".into(),
- messages: vec![
- EmailMessage {
- from: "[email protected]".into(),
- to: vec!["[email protected]".into()],
- cc: vec![],
- subject: "Q3 roadmap decision".into(),
- sent_at: Utc.timestamp_millis_opt(1_710_000_000_000).unwrap(),
- body: "We are committing to the Q3 roadmap with Phoenix as the \
+ IngestRequest {
+ source_kind: SourceKind::Email,
+ source_id: "gmail:thread-provenance-1".into(),
+ owner: "alice".into(),
+ tags: vec![],
+ payload: serde_json::to_value(EmailThread {
+ provider: "gmail".into(),
+ thread_subject: "Q3 roadmap decision".into(),
+ messages: vec![
+ EmailMessage {
+ from: "[email protected]".into(),
+ to: vec!["[email protected]".into()],
+ cc: vec![],
+ subject: "Q3 roadmap decision".into(),
+ sent_at: Utc.timestamp_millis_opt(1_710_000_000_000).unwrap(),
+ body: "We are committing to the Q3 roadmap with Phoenix as the \
flagship feature. [email protected] signed off."
- .into(),
- source_ref: Some("<[email protected]>".into()),
- list_unsubscribe: None,
- },
- EmailMessage {
- from: "[email protected]".into(),
- to: vec!["[email protected]".into()],
- cc: vec![],
- subject: "Re: Q3 roadmap decision".into(),
- sent_at: Utc.timestamp_millis_opt(1_710_000_060_000).unwrap(),
- body: "Confirmed. [email protected] will own the Phoenix delivery.".into(),
- source_ref: Some("<[email protected]>".into()),
- list_unsubscribe: None,
- },
- ],
+ .into(),
+ source_ref: Some("<[email protected]>".into()),
+ list_unsubscribe: None,
+ },
+ EmailMessage {
+ from: "[email protected]".into(),
+ to: vec!["[email protected]".into()],
+ cc: vec![],
+ subject: "Re: Q3 roadmap decision".into(),
+ sent_at: Utc.timestamp_millis_opt(1_710_000_060_000).unwrap(),
+ body: "Confirmed. [email protected] will own the Phoenix delivery.".into(),
+ source_ref: Some("<[email protected]>".into()),
+ list_unsubscribe: None,
+ },
+ ],
+ })
+ .expect("email thread serialises"),
},
)
.await
- .expect("ingest_email must succeed");
+ .expect("ingest_rpc(email) must succeed");
drain_until_idle(&cfg).await.expect("queue must drain");
let _ws_guard = set_workspace_env(&tmp);
- // List the ingested chunks directly to get leaf chunk ids with their refs.
- let chunks = tinymemory_core::store::chunks::store::list_chunks(
- &cfg,
- &tinymemory_core::store::chunks::store::ListChunksQuery::default(),
- )
- .expect("list_chunks must not error");
+ // List the ingested chunks through the host read RPC. Not the engine's
+ // `store::chunks::store::list_chunks`: ingest went through the bound
+ // driver, so this reads the same surface the product reads.
+ let chunks = read_rpc::list_chunks_rpc(&cfg, ChunkFilter::default())
+ .await
+ .expect("list_chunks must not error")
+ .value
+ .chunks;
assert!(!chunks.is_empty(), "ingest must produce at least one chunk");