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/flows/tinyflows/caps/http.rs,crates/openhuman-core/sr

Steven Enamakelf9e3a4392d95
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
index 4204b63f14..d376894ca0 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
@@ -177,8 +177,14 @@ impl HttpClient for OpenHumanHttp {
// `gate_call_for_tier` is what actually performs the `Prompt` round-trip
// — it escalates a Supervised `Prompt` decision into a forced approval
// regardless of the flow's own `require_approval` toggle (Codex P1).
- let tier_decision =
- enforce_node_tier_gate(&self.security, CommandClass::Network, "http_request")?;
+ let tier_decision = enforce_current_node_tier_gate(
+ &self.ctx,
+ &self.config,
+ &self.security,
+ CommandClass::Network,
+ "http_request",
+ )
+ .await?;
// The approval gate summarizes/redacts the request BEFORE any credential
// is injected, so a stored secret never lands in the approval UI or
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs
index da7fe07874..283e76988b 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs
@@ -114,14 +114,23 @@ impl ToolBackend for ComposioToolBackend {
// curation check (unlike the pre-fix behavior) so a read-only tier
// can never even probe which slugs are curated.
let composio_class = super::super::classify_composio_action_for_tier(slug).await;
- let tier_decision =
- super::super::enforce_node_tier_gate(ctx.security, composio_class, "tool_call")?;
+ let tier_policy = super::super::tier_policy_from_config(
+ ctx.dispatch,
+ ctx.config,
+ Some(&live_config),
+ ctx.security,
+ )?;
+ let tier_decision = super::super::enforce_node_tier_gate(
+ &tier_policy,
+ composio_class,
+ "tool_call",
+ )?;
tracing::debug!(
target: "flows",
%slug,
?composio_class,
?tier_decision,
- tier = ?ctx.security.autonomy,
+ tier = ?tier_policy.autonomy,
"[flows] tool_call: composio node tier gate evaluated"
);
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs
index 1a38e7bba3..8dbeb43d0d 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs
@@ -45,7 +45,14 @@ impl ToolBackend for NativeToolBackend {
let class = crate::tools::native_ops::classify_tool_call(ctx.config, tool_name, &args)
.map_err(EngineError::Capability)?;
- let tier_decision = super::super::enforce_node_tier_gate(ctx.security, class, "tool_call")?;
+ let tier_decision = super::super::enforce_current_node_tier_gate(
+ ctx.dispatch,
+ ctx.config,
+ ctx.security,
+ class,
+ "tool_call",
+ )
+ .await?;
let summary = crate::security::approval::summarize_action(tool_name, &args);
let redacted = crate::security::approval::redact_args(&args);
let (outcome, audit_id) = super::super::gate_call_for_tier(
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
index bcf0b3238a..1f263bfe7f 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
@@ -56,7 +56,7 @@ use tinybox_bus::CommandClass;
use tinymemory_api::wrap_untrusted_for_agent;
use tinymemory_api::{Hit, LearningKind, MemoryMeta, MetaFilter, SourceKind};
-use super::caps::{enforce_node_tier_gate, gate_call_for_tier};
+use super::caps::{enforce_current_node_tier_gate, gate_call_for_tier};
/// Stable `tracing` grep prefix for every log line this adapter emits. Never
/// logs memory *content* or PII — only operation names, scopes, resolved
@@ -123,8 +123,15 @@ impl OpenHumanMemory {
/// a guaranteed-`Allow` decision through `intercept_audited` anyway would
/// only reintroduce the "reads wait for approval" bug that short-circuit
/// was added to close.
- fn tier_gate_read(&self, op: &str) -> Result<()> {
- enforce_node_tier_gate(&self.security, CommandClass::Read, op)?;
+ async fn tier_gate_read(&self, op: &str) -> Result<()> {
+ enforce_current_node_tier_gate(
+ &self.ctx,
+ &self.config,
+ &self.security,
+ CommandClass::Read,
+ op,
+ )
+ .await?;
Ok(())
}
@@ -145,7 +152,14 @@ impl OpenHumanMemory {
/// see that function's doc for why (E-m1).
async fn tier_gate_write(&self, op: &str, action: &Value) -> Result<Option<String>> {
let tool_name = format!("flows_memory_{op}");
- let tier_decision = enforce_node_tier_gate(&self.security, CommandClass::Write, op)?;
+ let tier_decision = enforce_current_node_tier_gate(
+ &self.ctx,
+ &self.config,
+ &self.security,
+ CommandClass::Write,
+ op,
+ )
+ .await?;
let summary = summarize_action(&tool_name, action);
let redacted = redact_args(action);
let (outcome, audit_id) = gate_call_for_tier(
@@ -257,7 +271,7 @@ impl MemoryProvider for OpenHumanMemory {
"{LOG_PREFIX} recall: entry"
);
- self.tier_gate_read(operation)?;
+ self.tier_gate_read(operation).await?;
let filter = self.scope_filter(scope)?;
let (answer, results): (Option<String>, Vec<Value>) = if operation == "search" {
@@ -320,7 +334,7 @@ impl MemoryProvider for OpenHumanMemory {
/// Memory v2 keeps no flavoured profiles, so every slug is unknown.
async fn flavour(&self, slug: &str) -> Result<Value> {
tracing::debug!(target: "flows", flavour = slug, "{LOG_PREFIX} flavour: unsupported");
- self.tier_gate_read("flavour")?;
+ self.tier_gate_read("flavour").await?;
Err(EngineError::Capability(format!(
"memory node: unknown flavour \"{slug}\" (this host's memory keeps no flavour profiles)"
)))
@@ -333,7 +347,7 @@ impl MemoryProvider for OpenHumanMemory {
has_query = query.is_some_and(|q| !q.trim().is_empty()),
"{LOG_PREFIX} people: unsupported, empty listing"
);
- self.tier_gate_read("people")?;
+ self.tier_gate_read("people").await?;
Ok(json!({ "people": [], "supported": false }))
}