Skip to content

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

feat(tinyflows): add workflow readiness check to proxies

Steven Enamakeld94af04ac115
diff --git a/crates/openhuman-core/src/modules/tinyflows.rs b/crates/openhuman-core/src/modules/tinyflows.rs
index 96e07fc616..71c85ddb05 100644
--- a/crates/openhuman-core/src/modules/tinyflows.rs
+++ b/crates/openhuman-core/src/modules/tinyflows.rs
@@ -92,6 +92,14 @@ mod imp {
}
}
+ async fn ensure_workflow_ready(config: &Config) -> Result<(), String> {
+ #[cfg(feature = "flows")]
+ crate::storage::import::tinyflows::ensure_flow_scope_ready(config).await?;
+ #[cfg(not(feature = "flows"))]
+ let _ = config;
+ Ok(())
+ }
+
async fn schedule_proxy(
config: &Config,
timeout: std::time::Duration,
@@ -129,6 +137,7 @@ mod imp {
/// Proxy to the module-owned Authoring contract.
pub(crate) async fn authoring_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure_workflow_ready(config).await?;
ensure(config).await?;
let runtime = runtime::runtime()
.await
@@ -146,6 +155,14 @@ mod imp {
/// Proxy to the module-owned Catalog contract.
pub(crate) async fn catalog_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure_workflow_ready(config).await?;
+ catalog_proxy_for_migration(config).await
+ }
+
+ /// Catalog proxy used only while migrations or bounded legacy imports run.
+ pub(crate) async fn catalog_proxy_for_migration(
+ config: &Config,
+ ) -> Result<Proxy, String> {
ensure(config).await?;
let runtime = runtime::runtime()
.await
@@ -163,6 +180,7 @@ mod imp {
/// Proxy to the module-owned portability helpers used by CapsHost.
pub(crate) async fn portability_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure_workflow_ready(config).await?;
ensure(config).await?;
let runtime = runtime::runtime()
.await
@@ -180,6 +198,7 @@ mod imp {
/// Proxy to the module-owned run admission and control surface.
pub(crate) async fn runs_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure_workflow_ready(config).await?;
ensure(config).await?;
let runtime = runtime::runtime()
.await
@@ -224,11 +243,13 @@ mod imp {
/// A proxy for the module's Copilot tool, prompt and fallback services.
pub(crate) async fn copilot_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure_workflow_ready(config).await?;
copilot_interface_proxy(config).await
}
/// A long-deadline Copilot proxy for module-owned tool execution.
pub(crate) async fn copilot_invoke_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure_workflow_ready(config).await?;
copilot_invoke_interface_proxy(config).await
}