The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(storage): fingerprint decoded session rows instead of raw snapshot
Steven Enamakel10ffc1670136
diff --git a/crates/openhuman-core/src/storage/import/session_db.rs b/crates/openhuman-core/src/storage/import/session_db.rsindex 56c2090e42..017e4cf223 100644--- a/crates/openhuman-core/src/storage/import/session_db.rs+++ b/crates/openhuman-core/src/storage/import/session_db.rs@@ -20,7 +20,7 @@ use crate::storage::rusqlite::{self, types::ValueRef};/// Typed rows from the historical session database, in deterministic source/// order. The owner import operation performs the destination preflight and/// checked batch write.-#[derive(Debug, Default)]+#[derive(Debug, Default, serde::Serialize)]pub(crate) struct SessionDatabase {pub sessions: Vec<SessionRecord>,pub messages: Vec<SessionMessage>,diff --git a/crates/openhuman-core/src/storage/import/sessions.rs b/crates/openhuman-core/src/storage/import/sessions.rsindex 06c70a8e87..d3e8bd6cf3 100644--- a/crates/openhuman-core/src/storage/import/sessions.rs+++ b/crates/openhuman-core/src/storage/import/sessions.rs@@ -97,7 +97,7 @@ fn import(backend: &Arc<dyn StorageBackend>, config: &Config) -> Result<Outcome>let mut rows = super::session_db::SessionDatabase::read(snapshot.db()).context("[sessions] read the session database snapshot")?;sanitize_legacy_system_messages(&mut rows.messages);- let fingerprint = source_fingerprint(snapshot.db())?;+ let fingerprint = source_fingerprint(&rows)?;let history_batch = SessionHistoryImport {sessions: rows.sessions,messages: rows.messages,@@ -196,10 +196,9 @@ fn database_totals(counts: [ImportCounts; 11]) -> (usize, usize) {)}-fn source_fingerprint(path: &Path) -> Result<String> {+fn source_fingerprint<T: serde::Serialize>(rows: &T) -> Result<String> {use sha2::{Digest, Sha256};- let bytes =- std::fs::read(path).with_context(|| format!("read source snapshot {}", path.display()))?;+ let bytes = serde_json::to_vec(rows).context("serialize decoded legacy session rows")?;Ok(format!("sha256:{}", hex::encode(Sha256::digest(bytes))))}