Skip to content

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

refactor(flows): adjust langfuse export module structure

Steven Enamakelf7d81a97b250
diff --git a/crates/openhuman-core/src/flows/ops/execution.rs b/crates/openhuman-core/src/flows/ops/execution.rs
index 9b7b843f12..07e47403b9 100644
--- a/crates/openhuman-core/src/flows/ops/execution.rs
+++ b/crates/openhuman-core/src/flows/ops/execution.rs
@@ -9,6 +9,9 @@ use tinyflows_catalog::Flow;
use crate::config::Config;
+#[path = "langfuse_export.rs"]
+mod langfuse_export;
+
/// Exports one module-projected run segment to Langfuse. Failures remain
/// best-effort and cannot change a workflow result.
pub(crate) async fn export_run_to_langfuse(
@@ -20,7 +23,7 @@ pub(crate) async fn export_run_to_langfuse(
trigger: FlowRunTrigger,
observations: &[GraphObservation],
) {
- crate::flows::tinyflows::langfuse_export::export_flow_run_trace(
+ langfuse_export::export_flow_run_trace(
config,
flow_name,
flow_id,
diff --git a/crates/openhuman-core/src/flows/ops/langfuse_export.rs b/crates/openhuman-core/src/flows/ops/langfuse_export.rs
index 88389f6e96..ed0dcee3f2 100644
--- a/crates/openhuman-core/src/flows/ops/langfuse_export.rs
+++ b/crates/openhuman-core/src/flows/ops/langfuse_export.rs
@@ -1,9 +1,8 @@
//! Langfuse export for `flows::` graph runs.
//!
//! After a `flows_run` / `flows_resume` settles, the `flows::` domain hands
-//! this module the run's durable [`GraphObservation`] slice (captured by the
-//! per-run in-memory journal that `tinyflows`' journaled entry points fill)
-//! and it exports the run as one Langfuse trace via the backend's Langfuse
+//! this module the run's [`GraphObservation`] slice collected from the Runs
+//! bus event stream, and it exports the run as one Langfuse trace via the backend's Langfuse
//! OTLP proxy route (Langfuse v4; the legacy batch ingestion path is not used
//! for traces).
//!
@@ -159,7 +158,7 @@ pub async fn export_flow_run_trace(
target: LOG_TARGET,
flow_id = %flow_id,
thread_id = %thread_id,
- "[flows] langfuse export skipped: run journal is empty"
+ "[flows] langfuse export skipped: PollRun observations are empty"
);
return;
}
diff --git a/crates/openhuman-core/src/flows/tinyflows/mod.rs b/crates/openhuman-core/src/flows/tinyflows/mod.rs
index ec6b3facb3..8f651cb080 100644
--- a/crates/openhuman-core/src/flows/tinyflows/mod.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/mod.rs
@@ -6,5 +6,3 @@
//! generic graph model and legacy graph migration needed by host-facing APIs.
pub use ::tinyflows::{migrate, model};
-
-pub(crate) mod langfuse_export;
diff --git a/crates/openhuman-core/src/memory/mod.rs b/crates/openhuman-core/src/memory/mod.rs
index d01bde1c1d..b51b43799f 100644
--- a/crates/openhuman-core/src/memory/mod.rs
+++ b/crates/openhuman-core/src/memory/mod.rs
@@ -22,6 +22,7 @@ pub mod backfill;
pub mod billing;
pub mod brain;
pub mod bus;
+pub mod confine;
pub mod deletion;
pub mod engine;
pub mod engine_registry;
@@ -43,6 +44,8 @@ pub(crate) mod tool_writes;
pub mod tools;
pub mod types;
+pub use error::{MemoryError, MemoryResult};
+
#[cfg(test)]
pub(crate) mod test_fixtures;