The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
feat(profiles): add direct provider and operator tool capabilities
Steven Enamakele1bdd3b48f2f
diff --git a/crates/openhuman-core/src/core/runtime/saas.rs b/crates/openhuman-core/src/core/runtime/saas.rsindex e973080112..8186c7aac5 100644--- a/crates/openhuman-core/src/core/runtime/saas.rs+++ b/crates/openhuman-core/src/core/runtime/saas.rs@@ -137,7 +137,10 @@ impl std::fmt::Debug for SaasConfig {.field("shared_backend_api_key", &self.shared_backend_api_key).field("custom_definitions", &self.custom_definitions).field("require_user_signature", &self.require_user_signature)- .field("storage_url", &self.storage_url.as_ref().map(|_| "<redacted>"))+ .field(+ "storage_url",+ &self.storage_url.as_ref().map(|_| "<redacted>"),+ ).field("node_id", &self.node_id).field("advertise_url", &self.advertise_url).field("lease_ttl_secs", &self.lease_ttl_secs)diff --git a/crates/openhuman-core/src/profiles/capabilities.rs b/crates/openhuman-core/src/profiles/capabilities.rsindex 003592efdc..5293e681da 100644--- a/crates/openhuman-core/src/profiles/capabilities.rs+++ b/crates/openhuman-core/src/profiles/capabilities.rs@@ -70,7 +70,10 @@ impl ProfileCapabilities {/// registered although their domain family is off for profiles.pub fn names_admittable(&self, name: &str) -> bool {super::tools::OPERATOR_ADMITTABLE.contains(&name)- && self.names.as_ref().is_some_and(|names| names.contains(name))+ && self+ .names+ .as_ref()+ .is_some_and(|names| names.contains(name))}/// Whether a selected name may reach the host permission decision.diff --git a/crates/openhuman-embed/Cargo.toml b/crates/openhuman-embed/Cargo.tomlindex 8ad6adc11c..b3652f2128 100644--- a/crates/openhuman-embed/Cargo.toml+++ b/crates/openhuman-embed/Cargo.toml@@ -136,6 +136,11 @@ required-features = ["channels"]name = "profile_cron_sweep"required-features = ["channels"]+# Operator-admitted cron and time tools, the iteration cap, no backend credential.+[[test]]+name = "profile_operator_tools"+required-features = ["channels"]+[[example]]name = "profiles"required-features = ["channels"]diff --git a/crates/openhuman-embed/tests/profile_direct_providers.rs b/crates/openhuman-embed/tests/profile_direct_providers.rsindex 0a72e17eff..16800001c7 100644--- a/crates/openhuman-embed/tests/profile_direct_providers.rs+++ b/crates/openhuman-embed/tests/profile_direct_providers.rs@@ -12,7 +12,6 @@ use common::{use openhuman_embed::config::{SearchConfig, SearchEngineCredentials, SearchPresentation, SearchProviderSettings, SearchRole,};-use openhuman_embed::profiles::ProfileCredentialKind;use openhuman_embed::seams::ToolHookDecision;use openhuman_embed::{DirectProfileProvider, PermissionLevel, ProfileRuntime, SaasConfig, ToolScopeSpec,@@ -170,15 +169,8 @@ async fn scenario() {.build().await.unwrap();- let provisioned = runtime.provision("alice").await.unwrap();- runtime- .set_credential(- &provisioned.profile_id,- ProfileCredentialKind::ApiKey,- "fixture-key",- )- .await- .unwrap();+ // No `set_credential`: a direct chat provider needs no backend credential.+ runtime.provision("alice").await.unwrap();let handle = runtime.open("alice").await.unwrap();let reply = handle.chat("t1", "look things up").await.unwrap();assert_eq!(reply.text, "done");diff --git a/crates/openhuman-embed/tests/profile_operator_tools.rs b/crates/openhuman-embed/tests/profile_operator_tools.rsindex d342ede823..ddd477e5b4 100644--- a/crates/openhuman-embed/tests/profile_operator_tools.rs+++ b/crates/openhuman-embed/tests/profile_operator_tools.rs@@ -8,7 +8,9 @@ mod common;use std::sync::{Arc, Mutex};use std::time::Duration;-use common::{chat_completion, chat_requests, runtime_without_master_key, tool_names, PointedTransport};+use common::{+ chat_completion, chat_requests, runtime_without_master_key, tool_names, PointedTransport,+};use openhuman_embed::seams::ToolHookDecision;use openhuman_embed::{CronDelivery, CronReply, DirectProfileProvider, JobOrigin, PermissionLevel, ProfileRuntime,@@ -204,5 +206,8 @@ async fn scenario() {.map(|r| r.url.path().to_owned()).filter(|p| p.contains("chat") || p.contains("completions") || p.contains("openai")).collect();- assert!(managed_paths.is_empty(), "managed inference: {managed_paths:?}");+ assert!(+ managed_paths.is_empty(),+ "managed inference: {managed_paths:?}"+ );}