Skip to content

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

style: reformat session store code and tests

Steven Enamakeld4ff12ccf523
diff --git a/crates/openhuman-core/src/agent/session_store/mod_tests.rs b/crates/openhuman-core/src/agent/session_store/mod_tests.rs
index fee4b138bf..cf27d13965 100644
--- a/crates/openhuman-core/src/agent/session_store/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/session_store/mod_tests.rs
@@ -25,7 +25,12 @@ async fn work_outside_an_agent_context_uses_the_default_agent() {
// No agent context in a unit test: the shared default bucket.
assert_eq!(
key,
- Some(provider.for_agent(DEFAULT_AGENT).transcripts.destination_key())
+ Some(
+ provider
+ .for_agent(DEFAULT_AGENT)
+ .transcripts
+ .destination_key()
+ )
);
assert!(current().is_none() || is_installed());
}
diff --git a/crates/openhuman-embed/tests/session_store.rs b/crates/openhuman-embed/tests/session_store.rs
index deb2114123..61af5d436b 100644
--- a/crates/openhuman-embed/tests/session_store.rs
+++ b/crates/openhuman-embed/tests/session_store.rs
@@ -114,8 +114,8 @@ fn a_stateless_runtime_keeps_every_conversation_in_its_session_store() {
.await
.expect("resumed turn");
let requests = chat_requests(&model).await;
- let resumed = String::from_utf8_lossy(&requests.last().expect("a request").body)
- .into_owned();
+ let resumed =
+ String::from_utf8_lossy(&requests.last().expect("a request").body).into_owned();
assert!(
resumed.contains("remember the table is for two")
&& resumed.contains("and at eight"),
@@ -157,7 +157,12 @@ fn a_stateless_runtime_keeps_every_conversation_in_its_session_store() {
// Nothing durable reached the scratch workspace.
let written = files_under(&scratch);
- for durable in ["session_raw", "session_db", "tinyagents_store", "turn_states"] {
+ for durable in [
+ "session_raw",
+ "session_db",
+ "tinyagents_store",
+ "turn_states",
+ ] {
assert!(
!written.iter().any(|path| path.contains(durable)),
"{durable} must not be written with a host store: {written:?}"
diff --git a/crates/openhuman-store-sqlite/src/lib.rs b/crates/openhuman-store-sqlite/src/lib.rs
index c675115742..57ec26c6be 100644
--- a/crates/openhuman-store-sqlite/src/lib.rs
+++ b/crates/openhuman-store-sqlite/src/lib.rs
@@ -95,11 +95,9 @@ impl SessionStoreProvider for SqliteSessionStores {
fn recover(&self) -> anyhow::Result<()> {
let workspace = self.current();
let now = chrono::Utc::now().to_rfc3339();
- let turns = tinyagents_session::turn_state::store::mark_all_interrupted(
- workspace.clone(),
- &now,
- )
- .map_err(anyhow::Error::msg)?;
+ let turns =
+ tinyagents_session::turn_state::store::mark_all_interrupted(workspace.clone(), &now)
+ .map_err(anyhow::Error::msg)?;
let runs = tinyagents_session::run_ledger::interrupt_orphaned_agent_runs(&workspace)?;
log::info!(
"[store-sqlite] recovered workspace={} interrupted_turns={turns} settled_runs={runs}",
diff --git a/crates/openhuman-store-sqlite/src/lib_tests.rs b/crates/openhuman-store-sqlite/src/lib_tests.rs
index abab468c93..009c79c204 100644
--- a/crates/openhuman-store-sqlite/src/lib_tests.rs
+++ b/crates/openhuman-store-sqlite/src/lib_tests.rs
@@ -40,7 +40,11 @@ fn recovery_interrupts_turns_left_in_flight() {
.unwrap();
stores.recover().unwrap();
assert_eq!(
- agent.turn_states.get("t").unwrap().map(|turn| turn.lifecycle),
+ agent
+ .turn_states
+ .get("t")
+ .unwrap()
+ .map(|turn| turn.lifecycle),
Some(TurnLifecycle::Interrupted)
);
}
diff --git a/vendor/tinyagents b/vendor/tinyagents
index 3625562348..b8561d5560 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit 3625562348ba0b81c9d72f6a0cffe4cd4e993b59
+Subproject commit b8561d5560b17276bdeef46980b60b33c25f82f1