Skip to content

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

fix(flows): stamp the proposal name into the proposed graph

M3gA-Mind3a6a179fbe3e
diff --git a/crates/openhuman-core/src/flows/ops/builder_gates.rs b/crates/openhuman-core/src/flows/ops/builder_gates.rs
index aee5ca27c6..18a0fb38cd 100644
--- a/crates/openhuman-core/src/flows/ops/builder_gates.rs
+++ b/crates/openhuman-core/src/flows/ops/builder_gates.rs
@@ -171,7 +171,13 @@ pub(crate) async fn build_builder_proposal(
// in `run_flow_body`) consumes, so a run right after this proposal reads
// the cached result instead of re-probing the network.
let inference_readiness = evaluate_inference_readiness(ctx, config, graph).await;
- let graph_value = graph.clone();
+ // The proposal's name is the one the builder resolved (its `name` argument,
+ // else the base graph's). A graph without its own name carried "" into the
+ // card and onto a save, so stamp the resolved name into the graph too.
+ let mut graph_value = graph.clone();
+ if let Some(graph_object) = graph_value.as_object_mut() {
+ graph_object.insert("name".to_string(), json!(name));
+ }
tracing::info!(
target: "flows",
diff --git a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
index 1c968436b0..9f9e335b8c 100644
--- a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
@@ -151,6 +151,42 @@ async fn proposal_omits_inference_status_for_tool_call_only_graph() {
);
}
+#[tokio::test]
+async fn proposal_graph_carries_the_proposal_name() {
+ // The builder resolves the name from its `name` argument; a graph authored
+ // without one used to reach the card (and a save) with an empty name.
+ let tmp = TempDir::new().unwrap();
+ let config = test_config(&tmp);
+
+ let g = graph(json!({
+ "name": "",
+ "nodes": [
+ { "id": "t", "kind": "trigger", "name": "Manual" },
+ { "id": "post", "kind": "tool_call", "name": "Post",
+ "config": { "slug": "oh:noop" } }
+ ],
+ "edges": [ { "from_node": "t", "to_node": "post" } ]
+ }));
+
+ let payload = build_builder_proposal(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ "edit_workflow",
+ "Daily Tech Digest",
+ &g,
+ false,
+ true,
+ None,
+ None,
+ None,
+ )
+ .await
+ .expect("proposal must succeed for a tool_call-only graph");
+
+ assert_eq!(payload["name"], json!("Daily Tech Digest"));
+ assert_eq!(payload["graph"]["name"], json!("Daily Tech Digest"));
+}
+
/// B45 run-time preflight (design correction, judge finding on live run
/// 104aab90): since authoring no longer hard-blocks on inference readiness, a
/// flow whose `agent` node cannot currently reach a working LLM provider can