Skip to content

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

feat(rpc): add session store to rpc server

Steven Enamakel0ff571f92dc3
diff --git a/crates/openhuman-rpc/src/server/mod.rs b/crates/openhuman-rpc/src/server/mod.rs
index 26cb1dc9ec..67ed040078 100644
--- a/crates/openhuman-rpc/src/server/mod.rs
+++ b/crates/openhuman-rpc/src/server/mod.rs
@@ -17,11 +17,11 @@
mod auth;
mod classify;
-mod cli;
+pub(crate) mod cli;
mod dev_connect;
pub(crate) mod http;
mod serve;
-mod shims;
+pub(crate) mod shims;
mod socketio;
#[cfg(test)]
mod testing;
diff --git a/crates/openhuman-rpc/src/session_store/mod.rs b/crates/openhuman-rpc/src/session_store/mod.rs
index 63cc15ef6c..a8d2adb602 100644
--- a/crates/openhuman-rpc/src/session_store/mod.rs
+++ b/crates/openhuman-rpc/src/session_store/mod.rs
@@ -134,9 +134,18 @@ fn stores_at(workspace: &Path) -> AgentStores {
/// sweep runs; the workspace is resolved per call because the desktop rebinds
/// it when a different user signs in.
pub fn install() {
- crate::core_host::agent::session_store::install(Arc::new(SqliteSessionStores::resolving(
+ log::debug!("[rpc:session_store] installing process-wide (context workspace)");
+ crate::core_host::agent::session_store::install(provider());
+}
+
+/// [`SqliteSessionStores`] over the current context's workspace, as the
+/// provider a runtime builder's `session_store` option takes (what
+/// [`crate::host::tui`] wires). [`install`] installs the same provider
+/// process-wide instead.
+pub fn provider() -> Arc<dyn SessionStoreProvider> {
+ Arc::new(SqliteSessionStores::resolving(
crate::core_host::agent::session_store::context_workspace_dir,
- )));
+ ))
}
#[cfg(test)]