Skip to content

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

docs(session_import): describe the storage-backed import and drop the dual-write

Steven Enamakeldd9b15baf9a0
diff --git a/crates/openhuman-core/src/agent/session_import/README.md b/crates/openhuman-core/src/agent/session_import/README.md
index 971c87a466..6cef48412b 100644
--- a/crates/openhuman-core/src/agent/session_import/README.md
+++ b/crates/openhuman-core/src/agent/session_import/README.md
@@ -1,26 +1,30 @@
# session_import
-Host side of the one-time migration of legacy OpenHuman session transcripts
-into TinyAgents `Store`/`AppendStore` records. The importer, the live
-dual-write and the shadow read moved to
-`tinyagents_session::transcript::import` (see its README for sources,
-destination layout and idempotency).
+Host side of the legacy-session import.
+
+The importer is `crate::storage::import::sessions`, run at boot (and when the
+desktop rebinds its workspace to a different user). It moves a classic
+workspace's `session_db/sessions.db`, `session_raw/*.jsonl` transcripts and
+turn-state JSON into the storage backend through TinyAgents' `legacy` reader:
+read-only, id-preserving and only-if-absent. See the storage README for the
+agent each record lands in.
What stays in OpenHuman:
-- [`schemas.rs`](./schemas.rs): the explicit `session_import.run` controller
- (`openhuman-core session_import run`, JSON-RPC
- `openhuman.session_import_run`). Never run from a boot hook.
-- [`live.rs`](./live.rs): whether the dual-write and shadow read run
- (`AgentConfig::session_dual_write` / `session_shadow_reads`, the
- `OPENHUMAN_SESSION_DUAL_WRITE` / `OPENHUMAN_SESSION_SHADOW_READS` kill
- switches) and the session KV store registered on `RunContext.stores`.
-- [`projector.rs`](./projector.rs): `journal_message_from_transcript`, the
- `JournalProjector` handed to the upstream importer so journal records carry
- the host's reconstructed sidecar metadata.
+- [`schemas.rs`](./schemas.rs): the `session_import.run` controller
+ (`openhuman-core session_import run`, JSON-RPC `openhuman.session_import_run`),
+ a manual retry of that import for a workspace. `dry_run` reports which legacy
+ sources exist and writes nothing.
+- [`live.rs`](./live.rs): the agent's key-value store registered on each turn's
+ `RunContext.stores` under `openhuman_sessions`.
+
+The file-era dual-write of transcripts into a second layout, its shadow read
+and the `OPENHUMAN_SESSION_DUAL_WRITE` / `OPENHUMAN_SESSION_SHADOW_READS` kill
+switches are gone: the backend is the only record. The
+`AgentConfig::session_dual_write` and `session_shadow_reads` fields remain so
+existing `config.toml` files still load; they have no effect.
## Further reading
- [Parent module README](../README.md)
- [Agent harness architecture](../../../../../gitbooks/developing/architecture/agent-harness.md)
-- [Chat](../../../../../gitbooks/features/chat.md)
diff --git a/crates/openhuman-rpc/src/server/README.md b/crates/openhuman-rpc/src/server/README.md
index 14d3730521..a0cfce250f 100644
--- a/crates/openhuman-rpc/src/server/README.md
+++ b/crates/openhuman-rpc/src/server/README.md
@@ -118,8 +118,9 @@ The bearer is the per-launch RPC token the core owns
`run_server_saas` (`--mode saas --saas-config <file>`) boots the operator's
config instead of a builder. Before boot it installs the session store for
the operator's storage URL (`OPENHUMAN_STORAGE_URL`, else `storage_url`)
-through `session_store::install_for_saas`: the on-disk store with no URL,
-else `DriverSessionStores` over that backend with `recover_on_open(false)`,
+through `session_store::install_for_saas`: one default database per profile
+workspace with no URL, else `DriverSessionStores` over that backend with
+`recover_on_open(false)`,
because a profile's turns are recovered when its lease is taken over, not
when its stores open. On shutdown it releases the leases of idle profiles.