Skip to content

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

fix(test): update test imports for events and middleware modules

Steven Enamakel78a34316645b
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_memory_and_hooks_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_memory_and_hooks_tests.rs
index 81fe7c9a9d..0d9cc32239 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_memory_and_hooks_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_memory_and_hooks_tests.rs
@@ -96,35 +96,3 @@ async fn embedder_tool_hooks_post_use_without_pre_call_falls_back_to_null() {
assert_eq!(post[0].2, Some(true));
}
-/// The OpenHuman tool vocabulary reaches the upstream middleware intact: the
-/// note names the host's recall and index-update tools, and `SKILL.md` edits do
-/// not close the cycle.
-#[tokio::test]
-async fn openhuman_spec_drives_the_upstream_memory_protocol() {
- use tinyagents_harness::middleware::{Middleware, ToolInvocationIdentity};
- let mw = crate::agent::tinyagents::middleware::memory_protocol_middleware(true);
- let mut call = TaToolCall {
- id: "c1".into(),
- name: "memory_store".into(),
- arguments: json!({}),
- invalid: None,
- };
- // One run context for both hooks: the middleware keys its protocol state
- // by run instance, so `before_tool` and `after_tool` must see the same run.
- let mut run_ctx = ctx();
- mw.before_tool(&mut run_ctx, &(), &mut call).await.unwrap();
- let mut result = TaToolResult::success("stored");
- mw.after_tool(
- &mut run_ctx,
- &(),
- &ToolInvocationIdentity::new("c1", "memory_store"),
- &mut result,
- )
- .await
- .unwrap();
- let text = result_text(&result);
- assert!(text.starts_with("stored"), "{text}");
- assert!(text.contains("(e.g. `memory_recall`)"), "{text}");
- assert!(text.contains("call `update_memory_md`"), "{text}");
- assert!(text.contains("MEMORY.md index"), "{text}");
-}
diff --git a/crates/openhuman-core/src/core/events_tests.rs b/crates/openhuman-core/src/core/events_tests.rs
index 4b6af4aa5d..6237de5c80 100644
--- a/crates/openhuman-core/src/core/events_tests.rs
+++ b/crates/openhuman-core/src/core/events_tests.rs
@@ -400,31 +400,6 @@ fn all_variants_have_correct_domain() {
},
"triage",
),
- // Tree Summarizer
- (
- DomainEvent::TreeSummarizerHourCompleted {
- namespace: "n".into(),
- node_id: "2024/03/15/14".into(),
- token_count: 500,
- },
- "tree_summarizer",
- ),
- (
- DomainEvent::TreeSummarizerPropagated {
- namespace: "n".into(),
- node_id: "2024/03/15".into(),
- level: "day".into(),
- token_count: 1000,
- },
- "tree_summarizer",
- ),
- (
- DomainEvent::TreeSummarizerRebuildCompleted {
- namespace: "n".into(),
- total_nodes: 10,
- },
- "tree_summarizer",
- ),
// Notification
(
DomainEvent::NotificationIngested {
@@ -479,29 +454,6 @@ fn all_variants_have_correct_domain() {
},
"system",
),
- // Memory tree
- (
- DomainEvent::DocumentCanonicalized {
- source_id: "gmail:abc".into(),
- source_kind: "email".into(),
- chunks_written: 3,
- chunk_ids: vec!["c1".into(), "c2".into(), "c3".into()],
- canonicalized_at: 1_700_000_000.0,
- body_preview: Some("Thanks,\nAlice".into()),
- },
- "memory",
- ),
- // Learning
- (
- DomainEvent::CacheRebuilt {
- added: 2,
- evicted: 1,
- kept: 5,
- total_size: 7,
- rebuilt_at: 1_700_000_000.0,
- },
- "learning",
- ),
// Auth
(
DomainEvent::SessionExpired {
@@ -620,17 +572,6 @@ fn workflows_changed_domain_and_name() {
assert_eq!(event.variant_name(), "WorkflowsChanged");
}
-#[test]
-fn memory_driver_bind_failed_domain_and_name() {
- let event = DomainEvent::MemoryDriverBindFailed {
- configured_driver: "supermemory".into(),
- bound_driver: "null".into(),
- reason: "external driver is untrusted".into(),
- };
- assert_eq!(event.domain(), "memory");
- assert_eq!(event.variant_name(), "MemoryDriverBindFailed");
-}
-
/// The Event Log's "agent" column is the only per-row context the stream
/// carries, so every MCP row must name its server there (#5931): the
/// supervisor's verdicts by the registry name a user knows the server by, the