Skip to content

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

refactor(profiles): simplify capability and provider checks

Steven Enamakel80ce368bc8ac
diff --git a/crates/openhuman-core/src/profiles/capabilities.rs b/crates/openhuman-core/src/profiles/capabilities.rs
index ca1d9017ed..35300d8afa 100644
--- a/crates/openhuman-core/src/profiles/capabilities.rs
+++ b/crates/openhuman-core/src/profiles/capabilities.rs
@@ -93,8 +93,7 @@ impl ProfileCapabilities {
)
&& !name.starts_with("delegate_")
&& !name.starts_with("mcp_")
- && !crate::tools::toolpacks::pack_for_tool(name)
- .is_some_and(|pack| pack.id == "workflows")
+ && crate::tools::toolpacks::pack_for_tool(name).is_none_or(|pack| pack.id != "workflows")
}
/// An explicitly named operation can pass the supervised gate only with a host callback.
diff --git a/crates/openhuman-core/src/profiles/provider_settings.rs b/crates/openhuman-core/src/profiles/provider_settings.rs
index ed2be939df..94b5bbb003 100644
--- a/crates/openhuman-core/src/profiles/provider_settings.rs
+++ b/crates/openhuman-core/src/profiles/provider_settings.rs
@@ -41,7 +41,7 @@ impl ProfileProviderSettings {
}
tinysearch_bus::role_for_tool(name)
.is_none()
- .then(|| std::borrow::Cow::Borrowed(name))
+ .then_some(std::borrow::Cow::Borrowed(name))
}
/// Validate operator-owned direct routes and their presentation.
diff --git a/crates/openhuman-embed/tests/profile_direct_providers.rs b/crates/openhuman-embed/tests/profile_direct_providers.rs
index 87a48107c9..946de71978 100644
--- a/crates/openhuman-embed/tests/profile_direct_providers.rs
+++ b/crates/openhuman-embed/tests/profile_direct_providers.rs
@@ -122,9 +122,9 @@ async fn scenario() {
.await;
PointedTransport::install(&managed.uri());
- let mut search = SearchConfig::default();
- search.presentation = SearchPresentation::Roles;
- search.providers = BTreeMap::from([
+ let mut search = SearchConfig {
+ presentation: SearchPresentation::Roles,
+ providers: BTreeMap::from([
("exa".into(), SearchProviderSettings::direct()),
("gemini".into(), SearchProviderSettings::direct()),
]);