Skip to content

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

style: apply rustfmt formatting to tinyflows caps

Steven Enamakeld4369e89b385
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
index cb73dc8938..3d9935ad57 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
@@ -451,9 +451,7 @@ impl OpenHumanAgentRunner {
// Cancellation: the run_registry token aborts the engine future, and the
// inner turn drops with it (task-local scope unwinds cleanly).
use crate::agent::turn_origin;
- let escalated_origin = escalated_origin_for_nested_harness(
- self.ctx.turn_origin(),
- );
+ let escalated_origin = escalated_origin_for_nested_harness(self.ctx.turn_origin());
if let Some(ref escalated) = escalated_origin {
tracing::debug!(
target: "flows",
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
index 58ae59c39a..4204b63f14 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
@@ -185,16 +185,15 @@ impl HttpClient for OpenHumanHttp {
// audit trail. Injection happens strictly after this point.
let summary = crate::security::approval::summarize_action(TOOL_NAME, &request);
let redacted = crate::security::approval::redact_args(&request);
- let (outcome, audit_id) =
- gate_call_for_tier(
- &self.ctx,
- &self.approval,
- tier_decision,
- TOOL_NAME,
- &summary,
- redacted,
- )
- .await;
+ let (outcome, audit_id) = gate_call_for_tier(
+ &self.ctx,
+ &self.approval,
+ tier_decision,
+ TOOL_NAME,
+ &summary,
+ redacted,
+ )
+ .await;
if let crate::security::approval::GateOutcome::Deny { reason } = outcome {
return Err(EngineError::Capability(reason));
}
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs
index 3b1d4f80c7..aa6f561f37 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs
@@ -105,10 +105,7 @@ pub(crate) async fn gate_call_for_tier(
return (crate::security::approval::GateOutcome::Allow, None);
};
- match escalated_origin_for_prompt(
- tier_decision,
- ctx.turn_origin(),
- ) {
+ match escalated_origin_for_prompt(tier_decision, ctx.turn_origin()) {
Some(escalated) => {
tracing::debug!(
target: "flows",
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 1f9ceb8d70..da7fe07874 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs
@@ -180,7 +180,7 @@ impl ToolBackend for ComposioToolBackend {
&summary,
redacted,
)
- .await
+ .await
};
if let crate::security::approval::GateOutcome::Deny { reason } = outcome {
tracing::warn!(
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
index b0ea9ad9ba..05c525103e 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
@@ -224,9 +224,17 @@ fn workflow_origin(flow_id: &str) -> AgentTurnOrigin {
}
}
+/// The adapter of a run for `flow_id`: its context carries the run's origin.
+fn adapter_for_run(flow_id: &str) -> (TempDir, OpenHumanMemory) {
+ let (tmp, mut adapter) = adapter(AutonomyLevel::Full);
+ adapter.ctx =
+ crate::core::runtime::DispatchCtx::unbound().with_turn_origin(workflow_origin(flow_id));
+ (tmp, adapter)
+}
+
#[tokio::test]
async fn remember_search_and_forget_round_trip_in_the_flows_own_scope() {
- let (_tmp, adapter) = adapter(AutonomyLevel::Full);
+ let (_tmp, adapter) = adapter_for_run("f1");
turn_origin::with_origin(workflow_origin("f1"), async {
adapter
.remember("flow", "sent", json!("newsletter item 42"))
@@ -270,7 +278,7 @@ async fn remember_search_and_forget_round_trip_in_the_flows_own_scope() {
#[tokio::test]
async fn flow_scope_never_sees_another_flows_items() {
- let (_tmp, adapter) = adapter(AutonomyLevel::Full);
+ let (_tmp, mut adapter) = adapter_for_run("f-other");
turn_origin::with_origin(workflow_origin("f-other"), async {
adapter
.remember("flow", "k", json!("other flow note"))
@@ -278,6 +286,8 @@ async fn flow_scope_never_sees_another_flows_items() {
.unwrap();
})
.await;
+ adapter.ctx =
+ crate::core::runtime::DispatchCtx::unbound().with_turn_origin(workflow_origin("f-mine"));
turn_origin::with_origin(workflow_origin("f-mine"), async {
let found = adapter
.recall("flow", "other flow note", json!({"operation": "search"}))