Skip to content

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

test(tools): cover memory tool gating when component is off

Steven Enamakelc8708ab7287c
diff --git a/Cargo.lock b/Cargo.lock
index 6cd395d30f..de38e34f91 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -152,7 +152,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -163,7 +163,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [
"anstyle",
"once_cell_polyfill",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -836,7 +836,7 @@ dependencies = [
"cap-primitives",
"cap-std",
"io-lifetimes 3.0.1",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -853,7 +853,7 @@ dependencies = [
"maybe-owned",
"rustix 1.1.5",
"rustix-linux-procfs",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
"winx",
]
@@ -1772,7 +1772,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -2009,7 +2009,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -4164,7 +4164,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -5617,7 +5617,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6187,7 +6187,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6256,7 +6256,7 @@ dependencies = [
"security-framework 3.7.0",
"security-framework-sys",
"webpki-root-certs",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -6876,7 +6876,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -7215,7 +7215,7 @@ dependencies = [
"getrandom 0.4.3",
"once_cell",
"rustix 1.1.5",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -7228,7 +7228,7 @@ dependencies = [
"parking_lot",
"rustix 1.1.5",
"signal-hook",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -7640,7 +7640,7 @@ dependencies = [
[[package]]
name = "tinychannels"
-version = "0.1.29"
+version = "0.1.26"
dependencies = [
"anyhow",
"async-imap",
@@ -7686,21 +7686,18 @@ dependencies = [
[[package]]
name = "tinychannels-bus"
-version = "0.1.29"
+version = "0.1.26"
dependencies = [
- "anyhow",
- "async-trait",
"base64 0.23.1",
"schemars",
"serde",
"serde_json",
"thiserror 2.0.20",
- "tokio",
]
[[package]]
name = "tinychannels-runtime"
-version = "0.1.29"
+version = "0.1.26"
dependencies = [
"anyhow",
"async-trait",
@@ -8168,7 +8165,7 @@ dependencies = [
[[package]]
name = "tinyskills"
-version = "0.4.0"
+version = "0.2.10"
dependencies = [
"cap-fs-ext",
"cap-std",
@@ -8178,7 +8175,6 @@ dependencies = [
"serde_norway",
"sha2 0.11.0",
"thiserror 2.0.20",
- "tinytools",
"tokio",
"url",
]
@@ -9674,7 +9670,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
diff --git a/crates/openhuman-core/src/tools/ops_tests_capability_gating_tests.rs b/crates/openhuman-core/src/tools/ops_tests_capability_gating_tests.rs
index c0968b6070..1cd641327c 100644
--- a/crates/openhuman-core/src/tools/ops_tests_capability_gating_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_capability_gating_tests.rs
@@ -299,6 +299,44 @@ fn memory_tool_is_registered_once_memory_is_on() {
);
}
+/// `[components] memory = false` unregisters the tool even with an engine
+/// installed, and the component's own RPC family answers `COMPONENT_DISABLED`.
+#[test]
+fn memory_tool_is_absent_when_the_memory_component_is_off() {
+ let tmp = TempDir::new().unwrap();
+ let mut cfg = test_config(&tmp);
+ crate::memory::test_fixtures::bind_reference(&cfg);
+ cfg.components.memory = false;
+ let security = Arc::new(SecurityPolicy::default());
+ let browser = BrowserConfig {
+ enabled: false,
+ allowed_domains: vec![],
+ session_name: None,
+ ..BrowserConfig::default()
+ };
+ let http = crate::config::HttpRequestConfig::default();
+ let tools = all_tools(
+ Arc::new(cfg.clone()),
+ &security,
+ AuditLogger::disabled(),
+ &browser,
+ &http,
+ tmp.path(),
+ &HashMap::new(),
+ &cfg,
+ );
+ let names = tool_names(&tools);
+ assert!(
+ !names.iter().any(|n| n == crate::memory::MEMORY_TOOL_NAME),
+ "got: {names:?}"
+ );
+ let off = crate::core::runtime::ComponentSet::from_config(&cfg.components);
+ assert!(!off.narrow_domains(crate::core::runtime::DomainSet::all()).memory);
+ let services = off.narrow_services(crate::core::runtime::ServiceSet::all());
+ assert!(!services.memory_queue && !services.memory_sync);
+ assert!(off.require("memory").is_err());
+}
+
/// The memory tool classifies as the Memory family (kept under `harness()`),
/// and the old `memory_`/`goals_` prefixes no longer claim anything.
#[test]