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/storage/import/sessions.rs,crates/openhuman-core/src/

Steven Enamakel071ba6c03268
diff --git a/crates/openhuman-core/src/storage/import/sessions.rs b/crates/openhuman-core/src/storage/import/sessions.rs
index 1724df9f60..c2b6d38bd8 100644
--- a/crates/openhuman-core/src/storage/import/sessions.rs
+++ b/crates/openhuman-core/src/storage/import/sessions.rs
@@ -132,9 +132,10 @@ fn database_totals(report: &LegacyDatabaseReport) -> (usize, usize) {
report.tool_effects,
]
.into_iter()
- .fold((0, 0), |(found, written), ImportCounts { read, imported, .. }| {
- (found + read, written + imported)
- })
+ .fold(
+ (0, 0),
+ |(found, written), ImportCounts { read, imported, .. }| (found + read, written + imported),
+ )
}
/// The agent definitions a stem may belong to, by the component their ids
diff --git a/crates/openhuman-core/src/storage/import/sessions_tests.rs b/crates/openhuman-core/src/storage/import/sessions_tests.rs
index 001f6b601d..38e1e2bdc0 100644
--- a/crates/openhuman-core/src/storage/import/sessions_tests.rs
+++ b/crates/openhuman-core/src/storage/import/sessions_tests.rs
@@ -200,3 +200,28 @@ fn a_stem_names_the_agent_it_was_written_by() {
);
assert_eq!(agent_of("plain", &known), None);
}
+
+#[test]
+fn database_import_totals_source_families_not_derived_fts_rows() {
+ let counts = |read, imported| ImportCounts {
+ read,
+ imported,
+ already_present: read - imported,
+ };
+ let report = LegacyDatabaseReport {
+ sessions: counts(1, 1),
+ messages: counts(2, 1),
+ tool_calls: counts(3, 2),
+ agent_runs: counts(4, 3),
+ telemetry: counts(5, 4),
+ events: counts(6, 5),
+ workflow_runs: counts(7, 6),
+ teams: counts(8, 7),
+ members: counts(9, 8),
+ tasks: counts(10, 9),
+ tool_effects: counts(11, 10),
+ fts_rows: 1_000,
+ };
+
+ assert_eq!(database_totals(&report), (66, 56));
+}