Skip to content

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

test(flows): add diagnostics logging for flows_create failures

Steven Enamakel537890ab856d
diff --git a/crates/openhuman-core/src/flows/ops_resume_decision_tests.rs b/crates/openhuman-core/src/flows/ops_resume_decision_tests.rs
index 6c0292cf24..63d853991b 100644
--- a/crates/openhuman-core/src/flows/ops_resume_decision_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_resume_decision_tests.rs
@@ -92,9 +92,22 @@ async fn flows_resume_with_mismatched_approvals_is_rejected() {
async fn flows_resume_with_the_correct_gate_completes_and_runs_downstream() {
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);
- let created = flows_create(&config, "gated".to_string(), approval_gated_graph(), false)
- .await
- .unwrap();
+ let created = flows_create(&config, "gated".to_string(), approval_gated_graph(), false).await;
+ if std::env::var_os("OPENHUMAN_TINYFLOWS_RUN_DIAGNOSTICS").is_some() {
+ if let Err(error) = &created {
+ let tenant_scoped = crate::core::runtime::DispatchCtx::ambient()
+ .tenant()
+ .map(|tenant| tenant.is_scoped())
+ .unwrap_or(false);
+ let module_state = crate::modules::ops::state_of("tinyflows");
+ eprintln!(
+ "flows_create after resume fixtures failed: {error}; workspace={}; tenant_scoped={tenant_scoped}; TinyFlows state={module_state:?}; artifact={:?}",
+ config.workspace_dir.display(),
+ crate::modules::local_artifact("tinyflows")
+ );
+ }
+ }
+ let created = created.unwrap();
let run = flows_run(
&crate::core::runtime::DispatchCtx::ambient(),