Skip to content

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

fix(storage): address review (no delete sweep, blocking bridge off async worker, pinned guard allowances, multiline scan, docs)

Steven Enamakeled9b3498c171
diff --git a/crates/openhuman-core/src/agent/orchestration/README.md b/crates/openhuman-core/src/agent/orchestration/README.md
index d7a41bbd5e..00befa43ad 100644
--- a/crates/openhuman-core/src/agent/orchestration/README.md
+++ b/crates/openhuman-core/src/agent/orchestration/README.md
@@ -176,7 +176,14 @@ races it against the inherited cancellation token. Execution itself routes throu
bus so detached runs that outlive their spawning turn are not left `running`
forever.
- `subagent_sessions/`: `SubagentSessionStore` writes
- `{workspace}/.openhuman/subagent_sessions.json` (atomic tmp-file rename).
+ `{workspace}/.openhuman/subagent_sessions.json` (atomic tmp-file rename), or
+ one `subagent_sessions` document per session under the acting agent's scope
+ when a storage backend is configured (`store_documents.rs`).
+- `running_subagents/task_ledger.rs`: the detached-task ledger is
+ `{workspace}/.openhuman/orchestration_tasks.jsonl`, or `orchestration_tasks`
+ documents per storage scope when a backend is configured
+ (`task_ledger_documents.rs`); the boot orphan sweep is skipped on a shared
+ backend.
- `delegation.rs`: checkpoints `DelegationState` through
`tinyagents_graph::SqliteCheckpointer` in `graph_checkpoints.db` under the
workspace.
diff --git a/crates/openhuman-core/src/integrations/composio/README.md b/crates/openhuman-core/src/integrations/composio/README.md
index f9ea577c9a..b971f63a20 100644
--- a/crates/openhuman-core/src/integrations/composio/README.md
+++ b/crates/openhuman-core/src/integrations/composio/README.md
@@ -61,7 +61,7 @@ triggers) from a real transport failure.
| [`crates/openhuman-core/src/integrations/composio/googlecalendar_args.rs`](./googlecalendar_args.rs) | Host IANA time-zone lookup; the calendar defaulting itself is `tinyconnectors::execute::apply_calendar_query_defaults` (#1714). |
| [`crates/openhuman-core/src/integrations/composio/identity.rs`](./identity.rs) | Resolves the connected account username for a toolkit via the connector module profile-fetch path (used by skill preflight identity gate). |
| [`crates/openhuman-core/src/integrations/composio/identity_store.rs`](./identity_store.rs) | Persists connected-account identities in `<workspace>/integrations/composio_identities.json`. |
-| [`crates/openhuman-core/src/integrations/composio/file_store.rs`](./file_store.rs) | Atomic JSON file helpers for the identity and user-scope files under `<workspace>/integrations/`. |
+| [`crates/openhuman-core/src/integrations/composio/file_store.rs`](./file_store.rs) | Atomic JSON file helpers for the identity and user-scope files under `<workspace>/integrations/`. With a storage backend configured the same values are `composio_state` documents under the acting agent's scope ([`file_store_documents.rs`](./file_store_documents.rs)) and the files are not used. |
| [`crates/openhuman-core/src/integrations/composio/direct_auth/mod.rs`](./direct_auth/mod.rs) | Direct-mode API-key health tracking: a process-local consecutive-401-failure counter (keyed by a non-logged key fingerprint) that short-circuits repeated invalid-key polling. |
| [`crates/openhuman-core/src/integrations/composio/trigger_history.rs`](./trigger_history.rs) | Process-global `OnceLock` handle to `tinyconnectors::triggers::TriggerArchive` (`init_global`/`global`). |
| [`crates/openhuman-core/src/integrations/composio/bus.rs`](./bus.rs) + `bus/` | Trigger, connection-created and config-changed subscribers, and their registration. |
diff --git a/crates/openhuman-core/src/platform/cost/README.md b/crates/openhuman-core/src/platform/cost/README.md
index 86709c480a..5c3ea4965a 100644
--- a/crates/openhuman-core/src/platform/cost/README.md
+++ b/crates/openhuman-core/src/platform/cost/README.md
@@ -66,7 +66,7 @@ None. The module has no `bus.rs` and no `DomainEvent` publishers/subscribers.
## Persistence
-- Append-only JSONL at `<workspace>/state/costs.jsonl`, one `CostRecord` per line.
+- Append-only JSONL at `<workspace>/state/costs.jsonl`, one `CostRecord` per line. When the host configured a storage backend (`crate::storage`), records are `cost_records` documents under the acting agent's scope instead ([`tracker_documents.rs`](./tracker_documents.rs)), and the file is not used; the period totals are recomputed from the scope's documents rather than cached.
- Legacy migration: a pre-existing `<workspace>/.openhuman/costs.db` is moved (rename, copy-fallback) to the new path on first `CostTracker::new`.
- In-memory caches in `CostStorage`: `daily_cost_usd` / `monthly_cost_usd` plus the cached day/year/month they pertain to; rebuilt by full file scan on construction and on period rollover. Malformed lines are skipped with a `warn`.
- Per-session in-memory `Vec<CostRecord>` (`session_costs`) backs the session figures in `get_summary`.