Skip to content

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

refactor(flows): move connection ref parsing out of tinyflows caps

Steven Enamakel1697a4cb0d77
diff --git a/crates/openhuman-core/src/flows/agent_route.rs b/crates/openhuman-core/src/flows/agent_route.rs
index aa9a3960e3..88c91b664e 100644
--- a/crates/openhuman-core/src/flows/agent_route.rs
+++ b/crates/openhuman-core/src/flows/agent_route.rs
@@ -60,7 +60,7 @@ pub(crate) fn harness_model_default_override(node_model: &str) -> String {
/// synthesizes a real `AgentDefinition` for it (issue B38/Gap 2), so it can
/// run the full tool loop — and [`AgentRoute::RegistryFallback`] for
/// anything else (no entry at all, or a disabled one, which
-/// [`crate::flows::tinyflows::caps::OpenHumanAgentRunner::run_via_registry_fallback`] itself rejects with a
+/// [`crate::flows::caps_host::OpenHumanAgentRunner::run_via_registry_fallback`] itself rejects with a
/// clear "is disabled" error rather than silently skipping it here). Pure
/// over the lookup result so the decision is unit-testable without a live
/// `Config`/registry.
diff --git a/crates/openhuman-core/src/flows/ops/connections.rs b/crates/openhuman-core/src/flows/ops/connections.rs
index 0c119e409c..49b54c9c5d 100644
--- a/crates/openhuman-core/src/flows/ops/connections.rs
+++ b/crates/openhuman-core/src/flows/ops/connections.rs
@@ -184,6 +184,12 @@ pub(crate) fn build_flow_connections(
out
}
+/// Return the trimmed nonempty name from a flow picker HTTP reference.
+pub(crate) fn http_credential_name(connection_ref: &str) -> Option<&str> {
+ let name = connection_ref.strip_prefix("http_cred:")?.trim();
+ (!name.is_empty()).then_some(name)
+}
+
/// Human-readable picker label for a named HTTP credential, e.g.
/// `"stripe (bearer)"`. Only the (non-secret) name + scheme — never the value.
fn http_credential_display(cred: &crate::security::credentials::HttpCredentialSummary) -> String {
diff --git a/crates/openhuman-core/src/flows/ops/definitions.rs b/crates/openhuman-core/src/flows/ops/definitions.rs
index c7ca9f7d8c..78bcb8e730 100644
--- a/crates/openhuman-core/src/flows/ops/definitions.rs
+++ b/crates/openhuman-core/src/flows/ops/definitions.rs
@@ -172,14 +172,12 @@ pub async fn flows_get(config: &Config, id: &str) -> Result<Outcome<Flow>, Strin
}
/// Loads a saved flow's portable [`WorkflowGraph`] by id, for the
-/// `sub_workflow`-by-`workflow_id` resolver capability
-/// (`tinyflows::caps::WorkflowResolver`, implemented in
-/// `crates/openhuman-core/src/flows/tinyflows/caps.rs`).
+/// `sub_workflow`-by-`workflow_id` resolver capability through the compiled
+/// TinyFlows module's Catalog contract.
///
/// Returns `Ok(None)` when no flow with that id exists (the resolver turns that
/// into a capability error naming the missing id), and `Err` only on a store
-/// failure. Kept sync (the underlying [`store::get_flow`] is sync) so the
-/// resolver can call it directly from its async method without a runtime hop.
+/// failure. Kept sync because the underlying [`store::get_flow`] is sync.
pub fn load_flow_graph(config: &Config, id: &str) -> Result<Option<WorkflowGraph>, String> {
tracing::debug!(target: "flows", flow_id = %id, "[flows] load_flow_graph: loading saved flow graph for sub_workflow resolver");
let graph = store::get_flow(config, id)
diff --git a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
index 30e56b16dc..a44a9c7741 100644
--- a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
@@ -389,7 +389,7 @@ fn build_flow_connections_emits_parseable_refs_for_both_kinds() {
// exact parser the caps seam uses on execution.
assert_eq!(gmail.connection_ref, "composio:gmail:ca_abc");
assert_eq!(
- crate::flows::tinyflows::caps::composio_connection_id(&gmail.connection_ref),
+ crate::integrations::composio::flow_gate::composio_connection_id(&gmail.connection_ref),
Some("ca_abc")
);
assert_eq!(gmail.toolkit.as_deref(), Some("gmail"));
@@ -401,7 +401,7 @@ fn build_flow_connections_emits_parseable_refs_for_both_kinds() {
assert_eq!(stripe.kind, "http");
assert_eq!(stripe.connection_ref, "http_cred:stripe");
assert_eq!(
- crate::flows::tinyflows::caps::http_cred_name(&stripe.connection_ref),
+ crate::flows::ops::connections::http_credential_name(&stripe.connection_ref),
Some("stripe")
);
assert_eq!(stripe.scheme.as_deref(), Some("bearer"));