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/ops/updates.rs,crates/openhuman-core/src/flows/

Steven Enamakel782a87b60bd0
diff --git a/crates/openhuman-core/src/flows/ops/updates.rs b/crates/openhuman-core/src/flows/ops/updates.rs
index 396f9a4764..6dbeea443d 100644
--- a/crates/openhuman-core/src/flows/ops/updates.rs
+++ b/crates/openhuman-core/src/flows/ops/updates.rs
@@ -127,16 +127,12 @@ async fn flows_update_inner(
let graph = match graph_json {
Some(raw) => {
let graph = validate_and_migrate_graph(ctx, config, raw).await?;
+ ensure_config_aware_engine_compatible(ctx, config, &graph).await?;
graph
}
- None => {
- validate_and_migrate_graph(
- ctx,
- config,
- serde_json::to_value(&existing.graph).map_err(|error| error.to_string())?,
- )
- .await?
- }
+ // Metadata-only updates preserve access to legacy graphs written by
+ // older versions, even when the current engine no longer accepts them.
+ None => existing.graph.clone(),
};
// B29 Rule 1 analogue: disarm every manual/none → automatic trigger
// transition, unconditionally. `now_auto` is safe to compute here (it
diff --git a/crates/openhuman-core/src/flows/ops/validation.rs b/crates/openhuman-core/src/flows/ops/validation.rs
index 5e45ee920a..573a5f5b6f 100644
--- a/crates/openhuman-core/src/flows/ops/validation.rs
+++ b/crates/openhuman-core/src/flows/ops/validation.rs
@@ -26,6 +26,10 @@ async fn validate_over_bus(
.map_err(|error| error.wire_message())
}
+fn is_engine_compatibility_error(code: &str) -> bool {
+ code.starts_with("unsupported_") || code.starts_with("incompatible_referenced_workflow")
+}
+
/// Validates and migrates a graph through TinyFlows, resolving saved children
/// through the host callback bound to the current invocation scope.
pub(crate) async fn validate_and_migrate_graph(
@@ -34,7 +38,11 @@ pub(crate) async fn validate_and_migrate_graph(
graph: Value,
) -> Result<WorkflowGraph, String> {
let report = validate_over_bus(ctx, config, graph).await?;
- if let Some(error) = report.errors.first() {
+ if let Some(error) = report
+ .errors
+ .iter()
+ .find(|error| !is_engine_compatibility_error(&error.code))
+ {
return Err(error.message.clone());
}
report
@@ -53,10 +61,7 @@ pub(crate) async fn config_aware_engine_compatibility_errors(
Ok(report
.errors
.into_iter()
- .filter(|error| {
- error.code.starts_with("unsupported_")
- || error.code.starts_with("incompatible_referenced_workflow")
- })
+ .filter(|error| is_engine_compatibility_error(&error.code))
.map(|error| format!("{}: {}", error.code, error.message))
.collect())
}