Skip to content

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

chore: files changed crates/openhuman-core/src/config/schema/tools/browser.rs,crates/openhuman-core/

Steven Enamakeldd71e9e85d23
diff --git a/crates/openhuman-core/src/config/schema/tools/browser.rs b/crates/openhuman-core/src/config/schema/tools/browser.rs
index 5dea327f7e..37ace44cc1 100644
--- a/crates/openhuman-core/src/config/schema/tools/browser.rs
+++ b/crates/openhuman-core/src/config/schema/tools/browser.rs
@@ -125,6 +125,11 @@ impl BrowserConfig {
.any(|listed| normalized_action(listed) == kind)
}
+ /// The canonical name of `kind` when it is allowed unattended.
+ pub fn unattended_kind(&self, _kind: &str) -> Option<&'static str> {
+ None
+ }
+
/// Entries of `unattended_actions` that name no known action kind. They
/// allow nothing; the loader reports them so a typo is not silent.
pub fn unknown_unattended_actions(&self) -> Vec<String> {
diff --git a/crates/openhuman-core/src/config/schema/tools/browser_tests.rs b/crates/openhuman-core/src/config/schema/tools/browser_tests.rs
index 2faf15b87b..fbc171e7e9 100644
--- a/crates/openhuman-core/src/config/schema/tools/browser_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tools/browser_tests.rs
@@ -66,3 +66,19 @@ fn known_unattended_names_match_the_gated_action_wire_names() {
]
);
}
+
+#[test]
+fn the_requested_kind_is_normalized_like_the_configured_entries() {
+ let config = with_unattended(&["click"]);
+ assert!(config.allows_unattended(" CLICK "));
+ assert!(config.allows_unattended("Click"));
+}
+
+#[test]
+fn an_allowed_kind_resolves_to_its_static_canonical_name() {
+ let config = with_unattended(&["Press"]);
+ let canonical: Option<&'static str> = config.unattended_kind(" PRESS ");
+ assert_eq!(canonical, Some("press"));
+ assert_eq!(config.unattended_kind("click"), None);
+ assert_eq!(config.unattended_kind("#secret selector"), None);
+}