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
test(embed): pin the agent lifecycle and approvals surface in the public API (#7032)
oxoxDev093b94a5979d
diff --git a/crates/openhuman-embed/tests/public_api.rs b/crates/openhuman-embed/tests/public_api.rsindex de78933097..dcb19c5f48 100644--- a/crates/openhuman-embed/tests/public_api.rs+++ b/crates/openhuman-embed/tests/public_api.rs@@ -1,10 +1,11 @@use std::sync::Arc;use openhuman_embed::{- Access, Agent, AgentDefinitionSpec, AgentSpec, AgentTurnOrigin, ApiKey, Core, CoreBuilder,- CoreRuntime, DomainSet, GroupMode, Harness, HostKind, Provider, Runtime, RuntimeBuilder,- RuntimeConfig, SandboxModeSpec, ServiceSet, ToolGroups, ToolScopeSpec, TrustedAccess,- TrustedAutomationSource, Workspace,+ Access, Agent, AgentDefinitionSpec, AgentError, AgentSpec, AgentTurnOrigin, ApiKey,+ ApprovalDecision, Approvals, ApprovalsError, Core, CoreBuilder, CoreError, CoreRuntime,+ DomainSet, GroupMode, Harness, HostKind, PendingApproval, Provider, RemoveAgent, Runtime,+ RuntimeBuilder, RuntimeConfig, SandboxModeSpec, ServiceSet, ToolGroups, ToolScopeSpec,+ TrustedAccess, TrustedAutomationSource, Workspace, DEFAULT_MAX_AGENTS,};#[test]@@ -27,6 +28,23 @@ fn exposes_the_host_facing_embedding_contract() {fn accepts_agent(_: Agent) {}fn accepts_agent_spec(_: AgentSpec) {}fn accepts_api_key(_: ApiKey) {}+ fn agent_approvals(agent: &Agent) -> Approvals {+ agent.approvals()+ }+ fn lists_pending(approvals: &Approvals) -> Result<Vec<PendingApproval>, ApprovalsError> {+ approvals.pending()+ }+ fn removes_agent<'a>(runtime: &'a Runtime, id: &str) -> RemoveAgent<'a> {+ runtime.remove_agent(id).purge()+ }+ fn lifecycle_errors(error: &AgentError) -> Option<usize> {+ match error {+ AgentError::AgentLimit { limit } => Some(*limit),+ AgentError::UnknownId(_) => None,+ AgentError::Call(CoreError::AgentRemoved { .. }) => None,+ _ => None,+ }+ }let _ = accepts_core;let _ = accepts_builder;@@ -41,9 +59,16 @@ fn exposes_the_host_facing_embedding_contract() {let _ = accepts_agent;let _ = accepts_agent_spec;let _ = accepts_api_key;+ let _ = agent_approvals;+ let _ = lists_pending;+ let _ = removes_agent;+ let _ = lifecycle_errors;+ let _ = ApprovalDecision::ApproveOnce;+ assert_eq!(DEFAULT_MAX_AGENTS, 1024);let _ = Runtime::builder().api_key("th_public_api")- .backend_url("https://backend.example");+ .backend_url("https://backend.example")+ .max_agents(DEFAULT_MAX_AGENTS);let _ = AgentSpec::new("public-api").system_prompt("You are a test.").definition(@@ -51,7 +76,13 @@ fn exposes_the_host_facing_embedding_contract() {.tools(ToolScopeSpec::Named(vec!["read_file".into()])).sandbox(SandboxModeSpec::ReadOnly),)- .access(Access::readonly())+ .subagents([("public-api-helper", AgentDefinitionSpec::new())])+ .access(+ Access::readonly()+ .auto_approve(["read_file"])+ .auto_approve_all(false)+ .approval_gate(true),+ ).action_dir("/tmp/embed-public-api").include_user_skills(false).config(|_config| {});