Skip to content

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

refactor(flows): extract owner resolution into a helper

Steven Enamakelb485fceb877f
diff --git a/crates/openhuman-core/src/flows/bus/owner.rs b/crates/openhuman-core/src/flows/bus/owner.rs
index ea695c029a..fc99e20694 100644
--- a/crates/openhuman-core/src/flows/bus/owner.rs
+++ b/crates/openhuman-core/src/flows/bus/owner.rs
@@ -20,6 +20,11 @@ static OWNERS: LazyLock<Mutex<HashMap<String, Option<String>>>> = LazyLock::new(
pub(super) async fn flow_owner(config: &Config, flow_id: &str) -> Option<String> {
// No backend: every record is `local`.
crate::storage::installed()?;
+ resolve(config, flow_id).await
+}
+
+/// [`flow_owner`]'s cache and lookup, across whatever scopes exist.
+async fn resolve(config: &Config, flow_id: &str) -> Option<String> {
let cached = OWNERS
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)