Skip to content

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

test(about_app): cover the computer component ceiling

Steven Enamakelde04ccd04595
diff --git a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs
index c54aa412bf..2538857614 100644
--- a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs
+++ b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs
@@ -551,3 +551,18 @@ fn v1_memory_capabilities_are_not_advertised() {
}
}
}
+
+#[test]
+fn computer_capabilities_disclose_the_components_ceiling() {
+ for id in ["settings.desktop_control", "workflows.computer_browser_automation"] {
+ let capability = lookup(id).unwrap_or_else(|| panic!("{id} is in the catalog"));
+ assert!(
+ capability.description.contains("[components] computer = false"),
+ "{id} must name the ceiling that switches it off"
+ );
+ assert!(
+ capability.description.contains("COMPONENT_DISABLED:computer"),
+ "{id} must name the typed error a switched-off computer answers"
+ );
+ }
+}
diff --git a/tests/components_e2e.rs b/tests/components_e2e.rs
index 2205254f25..ea26124668 100644
--- a/tests/components_e2e.rs
+++ b/tests/components_e2e.rs
@@ -52,6 +52,7 @@ fn disabled_component_answers_component_disabled_over_json_rpc() {
config.components.voice = false;
config.components.channels = false;
config.components.sandbox = false;
+ config.components.computer = false;
tinyhumans_boot::boot();
let _runtime = CoreBuilder::new(HostKind::Library)
.config(config)
@@ -120,6 +121,30 @@ fn disabled_component_answers_component_disabled_over_json_rpc() {
Some("sandbox")
);
+ // The computer ceiling closes every desktop and browser control
+ // surface, including the read-only pending-action listing.
+ for method in [
+ "openhuman.desktop_status",
+ "openhuman.desktop_probe",
+ "openhuman.desktop_pending",
+ "openhuman.modules_computer_status",
+ "openhuman.modules_browser_check_readiness",
+ ] {
+ let computer = rpc(&base, method).await;
+ assert_eq!(
+ computer.pointer("/error/message").and_then(Value::as_str),
+ Some("COMPONENT_DISABLED:computer"),
+ "{method}: {computer}"
+ );
+ assert_eq!(
+ computer
+ .pointer("/error/data/component")
+ .and_then(Value::as_str),
+ Some("computer"),
+ "{method}: {computer}"
+ );
+ }
+
// `modules.list` reports the same modules as Disabled, and only them.
let listed = rpc(&base, "openhuman.modules_list").await;
let modules = listed