Skip to content

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

Bind a driver where the routed reads need one, and persist the config the probe re-reads

Shanua5eec1b3b42d
diff --git a/src/core/memory_cli.rs b/src/core/memory_cli.rs
index be0fa61070..e78bb45c93 100644
--- a/src/core/memory_cli.rs
+++ b/src/core/memory_cli.rs
@@ -15,7 +15,6 @@ use anyhow::Result;
use std::io::Read;
use std::path::PathBuf;
-use crate::openhuman::memory::api::provider::MemoryDocuments;
use crate::openhuman::memory::api::types::NamespaceDocumentInput;
/// Entry point for `openhuman memory <subcommand>`.
diff --git a/src/openhuman/integrations/composio/ops_tests.rs b/src/openhuman/integrations/composio/ops_tests.rs
index 723775bd3e..c2cf24f13e 100644
--- a/src/openhuman/integrations/composio/ops_tests.rs
+++ b/src/openhuman/integrations/composio/ops_tests.rs
@@ -921,6 +921,11 @@ async fn notion_cleanup_targets_include_synced_page_sources() {
crate::openhuman::memory::host_impls::install_for_tests();
let tmp = tempfile::tempdir().unwrap();
let config = test_config(&tmp);
+ // The cleanup targets are read back through the bound driver now, so the
+ // test has to bind one — the writes below go through a client over the
+ // same workspace, and an unbound config resolves to the null driver,
+ // which serves nothing and would report no targets at all.
+ crate::openhuman::memory::test_support::install_tinycortex_for_test(&config);
let memory = std::sync::Arc::new(
MemoryClient::from_workspace_dir(config.workspace_dir.clone())
.expect("memory client should initialise"),
@@ -958,6 +963,11 @@ async fn notion_cleanup_targets_surface_corrupt_sync_state() {
crate::openhuman::memory::host_impls::install_for_tests();
let tmp = tempfile::tempdir().unwrap();
let config = test_config(&tmp);
+ // The cleanup targets are read back through the bound driver now, so the
+ // test has to bind one — the writes below go through a client over the
+ // same workspace, and an unbound config resolves to the null driver,
+ // which serves nothing and would report no targets at all.
+ crate::openhuman::memory::test_support::install_tinycortex_for_test(&config);
let memory = std::sync::Arc::new(
MemoryClient::from_workspace_dir(config.workspace_dir.clone())
.expect("memory client should initialise"),
@@ -993,10 +1003,9 @@ async fn drive_cleanup_targets_are_connection_scoped() {
.expect("memory client should initialise"),
);
- let targets =
- composio_memory_targets_for_connection(&config, Some("google_drive"), "conn-1")
- .await
- .expect("drive cleanup targets should resolve");
+ let targets = composio_memory_targets_for_connection(&config, Some("google_drive"), "conn-1")
+ .await
+ .expect("drive cleanup targets should resolve");
assert!(targets.contains(&MemoryCleanupTarget::Exact(
SourceKind::Document,
diff --git a/src/openhuman/modules/memory_host_tests.rs b/src/openhuman/modules/memory_host_tests.rs
index da26907ebc..7baea0bcf8 100644
--- a/src/openhuman/modules/memory_host_tests.rs
+++ b/src/openhuman/modules/memory_host_tests.rs
@@ -189,6 +189,20 @@ async fn api_key_falls_back_to_config_key_when_credential_store_is_empty() {
config.workspace_dir = dir.path().join("workspace");
config.config_path = dir.path().join("config.toml");
config.composio.api_key = Some("direct-key-from-config".to_owned());
+
+ // Persisted, not only constructed. `api_key` answers from a LIVE re-read so
+ // that a key the user changes mid-session is followed, and falls back to the
+ // install-time snapshot only when that read fails. A config that exists only
+ // in memory is not the case this test means to cover — the re-read would
+ // succeed against an empty file and quietly answer `None`, which is the
+ // fallback never firing rather than the fallback working.
+ std::fs::create_dir_all(dir.path()).expect("config dir");
+ std::fs::write(
+ &config.config_path,
+ toml::to_string(&config).expect("serialise config"),
+ )
+ .expect("write config");
+
let callbacks = ComposioCallbacks(Arc::new(config));
let answer = call(&callbacks, "ApiKey", json!([]))