Skip to content

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

docs(core): update module-level READMEs and fix a doc comment

Steven Enamakelc4972772f40f
diff --git a/crates/openhuman-core/src/bin/README.md b/crates/openhuman-core/src/bin/README.md
index 03725b7c51..47ddcedac9 100644
--- a/crates/openhuman-core/src/bin/README.md
+++ b/crates/openhuman-core/src/bin/README.md
@@ -1,41 +1,43 @@
# bin
-Auxiliary binaries built alongside the primary `openhuman-core` binary
-(`crates/openhuman-core/src/main.rs`, wired via `[[bin]]` in
-`crates/openhuman-core/Cargo.toml`). None of these ship in the desktop
-product; each is gated so it drops out of a default build.
+Auxiliary binaries declared as `[[bin]]` targets in
+`crates/openhuman-core/Cargo.toml` next to the primary `openhuman-core`
+binary (`src/main.rs`). None of these ship in the desktop product.
## Primary binary (not in this directory)
-`src/main.rs` is the actual `openhuman-core` entry point (`[[bin]] name =
-"openhuman-core"`). It restores default `SIGPIPE` handling, loads `.env`
-before Sentry init so a dotenv-only DSN is visible at startup, initializes
-Sentry under the `crash-reporting` feature, and scrubs secrets from every
-outgoing error report via `openhuman_core::core::log_redaction::scrub_secrets`
-before delegating to the CLI dispatcher.
+`src/main.rs` is the `openhuman-core` entry point. It restores default
+`SIGPIPE` handling on unix, loads `.env` before Sentry init so a dotenv-only
+DSN is visible at startup (the CLI dispatcher later re-runs
+`load_dotenv_for_cli`, which honors `OPENHUMAN_DOTENV_PATH`), initializes
+Sentry under the `crash-reporting` feature with a `before_send` that drops
+known-noise event classes (`core::observability::is_*` predicates) and scrubs
+secrets via `openhuman_core::core::log_redaction::scrub_secrets`, then hands
+the arguments to `openhuman_core::run_core_from_args`.
## Binaries in this directory
| Binary | Source | Required features | Purpose |
| --- | --- | --- | --- |
-| `test-mcp-stub` | `test_mcp_stub.rs` | none | Tiny stdio MCP server for tests |
+| `test-mcp-stub` | `test_mcp_stub.rs` | none (built by every `cargo test`) | Tiny stdio MCP server for tests |
| `openhuman-fleet` | `fleet.rs` | `http-server`, `bin-tools` | Process-per-user supervisor + reverse proxy |
| `rss-bench` | `rss_bench.rs` | `rss-bench` | Steady-state RSS benchmark for an embedded agent roster |
| `library-profile` | `library_profile/main.rs` (+ `harness.rs`, `mock.rs`, `scenarios/`) | `rss-bench` (add `rss-bench-dhat` for heap profiles) | Hermetic library-embedding profiling scenarios |
-`rss-bench` and `library-profile` share the default-OFF `rss-bench` feature so
-no benchmark code enters the shipped desktop/library build; build both with
-`cargo build --release --no-default-features --features rss-bench --bin
-rss-bench --bin library-profile`.
+`http-server` is in `default`; `bin-tools`, `rss-bench` and `rss-bench-dhat`
+are not, so a plain `cargo build` produces only `openhuman-core` and
+`test-mcp-stub`. Cargo skips the gated targets rather than failing to link.
### `test-mcp-stub`
-Speaks just enough of MCP 2024-11-05 (`initialize`, `tools/list`,
-`tools/call` for one `echo` tool) over newline-delimited JSON-RPC on
-stdin/stdout, exiting when stdin closes. Dependency-free beyond `serde_json`
-so it builds fast and stays reliable in CI. Used exclusively by
-`tests/mcp_registry_e2e.rs`, which spawns it via
-`env!("CARGO_BIN_EXE_test-mcp-stub")`.
+Speaks just enough MCP to satisfy `initialize`, `tools/list` and `tools/call`
+for one `echo` tool over newline-delimited JSON-RPC on stdin/stdout, exiting
+when stdin closes. `initialize` reports `PROTOCOL_VERSION` (`2025-11-25`).
+Dependency-free beyond `serde_json`. Tests spawn it through
+`env!("CARGO_BIN_EXE_test-mcp-stub")`: `tests/mcp_registry_e2e.rs`,
+`tests/mcp_registry_multi_server.rs`, `tests/mcp_setup_e2e.rs`,
+`tests/json_rpc_e2e.rs` and
+`tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs`.
### `openhuman-fleet`
@@ -53,28 +55,34 @@ Design is **process-per-user, not in-process multi-tenancy**:
security boundary** for arbitrary agent tools.
- The supervisor mints a distinct edge token (`EdgeToken`) per tenant for
clients and is the only holder of the tenants' core bearers
- (`CoreBearer`); the two types are kept deliberately distinct so they
- cannot be confused with each other.
+ (`CoreBearer`); the two newtypes are kept deliberately distinct so they
+ cannot be confused with each other. Minted edge tokens are written to the
+ file named by `--edge-token-output`.
- The reverse proxy forwards `POST /{user_id}/rpc` verbatim to that tenant's
core at `http://127.0.0.1:<port>/rpc`, so the JSON-RPC wire contract is
unchanged end to end.
-MVP scope uses explicit sequential port assignment with an authenticated
-JSON-RPC readiness probe before registering a tenant (a production
-supervisor would read each core's bound port from a ready file /
-`EmbeddedReadySignal` and reconcile membership against
-`tinyhumansai/backend`). Requires `http-server` because it embeds the axum
-control-plane server; under `--no-default-features` (no `http-server`) the
-target is skipped rather than failing to link.
+MVP scope uses explicit sequential port assignment (`--base-core-port`, tenant
+N on `base + N`) with an authenticated JSON-RPC readiness probe before
+registering a tenant; a production supervisor would read each core's bound
+port from a ready file / `EmbeddedReadySignal` and reconcile membership
+against `tinyhumansai/backend`. It requires `http-server` because it embeds
+the axum control-plane server, and `bin-tools` for `clap` and `env_logger`:
+
+```
+cargo build -p openhuman --features bin-tools --bin openhuman-fleet
+```
### `rss-bench`
Steady-state RSS benchmark for an embedded `openhuman_core` agent roster
(#5046). Mirrors the OpenCompany embedding contract: a bare `Agent` built
directly via `Agent::builder` (no `CoreBuilder`, no RPC, no background
-services) with an injected mock model, an in-process `"none"` memory
-backend, and a per-agent temp workspace. Builds a 1-agent and an 8-agent
-roster, runs one deterministic warm-up turn per agent, settles, then samples
+services) with an injected mock model, a hand-rolled no-op `Memory`
+(`NoopMemory`; `create_memory` with `backend: "none"` still builds a full
+`UnifiedMemory`, which would inflate the reading) and a per-agent temp
+workspace. Builds a 1-agent and an 8-agent roster, runs one deterministic
+warm-up turn per agent, settles, then samples
`/proc/self/{status,smaps_rollup}`.
Two modes: `--child --roster N` builds one roster in a fresh process and
@@ -83,7 +91,7 @@ default (parent) mode re-execs itself `--repeat` times per roster size for
independent cold samples, aggregates them, writes the raw JSON report
(`--out`), and prints a human summary. The pure sampling/aggregation logic
lives in `openhuman_core::platform::proc_metrics`; this binary is the
-fixture and process driver. Build and run:
+fixture and process driver. Build:
```
cargo build --release --features rss-bench --bin rss-bench
@@ -93,9 +101,10 @@ cargo build --release --features rss-bench --bin rss-bench
Hermetic, Rust-only library profiling workloads that measure production code
paths in fresh processes with network inference replaced by a deterministic
-provider (`library_profile/mock.rs`). Never enters shipped builds.
+provider (`library_profile/mock.rs`).
-Scenarios (`library-profile <scenario>`, `library_profile/scenarios/`):
+Scenarios (`library-profile <scenario>`, one module each under
+`library_profile/scenarios/`):
- `agent-turn` — a single cold agent turn (minimal library unit).
- `long-agent` — N warmed sequential turns with a per-turn checkpoint series.
@@ -105,20 +114,33 @@ Scenarios (`library-profile <scenario>`, `library_profile/scenarios/`):
- `subagent-storm` — K parallel researcher subagents in one instance: marginal RSS per subagent.
`memory-ingest` and `cold-phases` were removed with the in-process memory
-engine (openhuman#6161) and are not coming back as-is; re-adding them means
-measuring the memory module over the bus, a different scenario.
+engine (openhuman#6161); re-adding them means measuring the memory module
+over the bus, a different scenario (see `scenarios/mod.rs`).
stdout is always a single pretty-printed JSON object (the pinned schema in
`harness::ProfileResult`); every diagnostic goes to stderr with the stable
-`[library-profile]` prefix. With the `rss-bench-dhat` feature, dhat's global
-allocator and profiler are active: RSS/time numbers are perturbed, the
-result carries `"dhat": true`, and a `dhat-<scenario>.json` heap profile is
-written under `target/profile/rust-library/` (override via
-`OPENHUMAN_PROFILE_DHAT_OUT`).
+`[library-profile]` prefix. `OPENHUMAN_PROFILE_WORKER_THREADS` pins the tokio
+worker count (set `2` to simulate the 2 vCPU box). With the `rss-bench-dhat`
+feature, dhat's global allocator and profiler are active: RSS/time numbers
+are perturbed, the result carries `"dhat": true`, and a
+`dhat-<scenario>.json` heap profile is written under
+`target/profile/rust-library/` (override via `OPENHUMAN_PROFILE_DHAT_OUT`).
+
+The driver scripts under `scripts/profile/` build it with
+`cargo build --release --features rss-bench --bin library-profile`
+(`library-heap.sh` uses `--features rss-bench-dhat`). The slim recipe from
+`docs/library-benchmarking.md` (`library-bench.sh --slim`) builds both
+benchmark binaries without the contributor default features:
+
+```
+cargo build --release -p openhuman --no-default-features --features rss-bench \
+ --bin library-profile --bin rss-bench
+```
## See also
- [`docs/library-benchmarking.md`](../../../../docs/library-benchmarking.md) —
the benchmark environment, driver scripts under `scripts/profile/`, and
results, covering `rss-bench` and `library-profile`.
-- `tests/mcp_registry_e2e.rs` — the sole consumer of `test-mcp-stub`.
+- [`scripts/profile/README.md`](../../../../scripts/profile/README.md) — the
+ driver scripts themselves.
diff --git a/crates/openhuman-core/src/config/README.md b/crates/openhuman-core/src/config/README.md
index f479c9a184..09397350b9 100644
--- a/crates/openhuman-core/src/config/README.md
+++ b/crates/openhuman-core/src/config/README.md
@@ -1,6 +1,6 @@
# Config
-Authoritative TOML-backed configuration layer. Owns the `Config` schema (every domain section: agent, channels, memory, autonomy, voice, scheduler, observability, etc.), env-variable overrides, the per-user openhuman directory layout, runtime proxy settings, the daemon descriptor, and the settings CLI. ~870 files across the workspace reference `crate::config` — almost every other domain reads `Config` here.
+Authoritative TOML-backed configuration layer. Owns the `Config` schema (every domain section: agent, channels, memory, autonomy, voice, scheduler, observability, etc.), env-variable overrides, the per-user openhuman directory layout, runtime proxy settings, the daemon descriptor, and the settings CLI. ~870 files under `crates/openhuman-core/src/` reference `crate::config` — almost every other domain reads `Config` here.
## Layout
@@ -8,11 +8,11 @@ Authoritative TOML-backed configuration layer. Owns the `Config` schema (every d
| --- | --- |
| `schema/` | The `Config` struct, every section type, loading/saving, env overrides, migrations trigger point — see [schema/README.md](schema/README.md) |
| `ops/` | RPC/CLI mutation surface (`config::rpc`) built on the schema — see [ops/README.md](ops/README.md) |
-| `schemas/` | Controller schemas + thin RPC handlers for the `config` namespace |
+| `schemas/` | Controller schemas + thin RPC handlers for the `config` namespace (`controllers_part_0N.rs` via `include!`, `helpers.rs`, `schema_defs.rs` + `schemas_schema_part_0N.rs`); the method list is in the `//!` header of `schemas/mod.rs` |
| `migrations/` | Automatic, schema-version-gated startup data migrations — see [migrations/README.md](migrations/README.md) |
| `migration_helpers/` | User-triggered `migrate.{openclaw,hermes}` RPCs importing memory from other assistants — see [migration_helpers/README.md](migration_helpers/README.md) |
| `workspace/` | Workspace bootstrap + editable Persona Pack (`SOUL.md`/`IDENTITY.md`) file RPCs — see [workspace/README.md](workspace/README.md) |
-| `daemon.rs` | `DaemonConfig` — sidecar lifecycle / port descriptor |
+| `daemon.rs` | `DaemonConfig` — Tauri-supervisor bundle of `data_dir`/`workspace_dir` plus `autonomy`/`security`/`reliability`/`secrets`/`audit` sections (`from_app_data_dir`) |
| `settings_cli.rs` | `openhuman settings ...` CLI section-slicing helper |
| `tools.rs` | Read-only LLM-callable wrappers over config (snapshot, autonomy, search, runtime flags, data paths) |
| `workspace_handle.rs` | Opaque, stable digest identity for a workspace directory, used on the wire (Event Log, notification broadcast) so paths never leak |
@@ -22,12 +22,12 @@ Authoritative TOML-backed configuration layer. Owns the `Config` schema (every d
- `pub struct Config` — `schema/types.rs` (re-exported from `mod.rs`) — top-level user settings.
- Per-domain config structs and enums — re-exported from `mod.rs`; see [schema/README.md](schema/README.md) for the full section → struct table.
- Model constants: `DEFAULT_MODEL`, `MODEL_AGENTIC_V1`, `MODEL_CODING_V1`, `MODEL_REASONING_V1`, and others in `schema/types_part_01.rs`.
-- `pub struct DaemonConfig` — `daemon.rs` — sidecar lifecycle / port descriptor.
+- `pub struct DaemonConfig` — `daemon.rs` — Tauri-supervisor config wrapper (see Layout).
- `pub fn apply_runtime_proxy_to_builder` / `pub fn build_runtime_proxy_client` / `pub fn build_runtime_proxy_client_with_timeouts` / `pub fn runtime_proxy_config` / `pub fn set_runtime_proxy_config` — `schema/proxy.rs`.
- Workspace identity helpers: `pub fn clear_active_user`, `default_root_openhuman_dir`, `pre_login_user_dir`, `read_active_user_id`, `user_openhuman_dir`, `write_active_user_id`, `PRE_LOGIN_USER_ID` — `schema/load/dirs.rs`.
- `pub mod ops` (re-exported as `rpc`) — `ops/` — RPC handlers and settings mutation; see [ops/README.md](ops/README.md).
- `pub mod settings_cli` — `settings_cli.rs` — `openhuman settings ...` CLI surface.
-- RPC `config.{get_config, update_model_settings, update_memory_settings, update_runtime_settings, update_browser_settings, resolve_api_url, get_runtime_flags, set_browser_allow_all, workspace_onboarding_flag_exists, workspace_onboarding_flag_set, update_analytics_settings, get_analytics_settings, update_meet_settings, get_meet_settings, agent_server_status, reset_local_data, get_onboarding_completed, get_dictation_settings, update_dictation_settings, get_voice_server_settings, update_voice_server_settings, set_onboarding_completed}` — `schemas/`.
+- RPC namespace `config` — 42 methods (`get_config`, `update_model_settings`, `update_autonomy_settings`, `set_privacy_mode`, `reset_local_data`, ...) — `schemas/`; the full list is the `//!` header of `schemas/mod.rs` and `all_controller_schemas()` in `schemas/controllers_part_01.rs`.
## Calls into
@@ -37,12 +37,12 @@ Authoritative TOML-backed configuration layer. Owns the `Config` schema (every d
## Called by
-- ~870 files across the workspace pull `Config` for their slice.
+- ~870 files under `crates/openhuman-core/src/` pull `Config` for their slice.
- Hot consumers: `crates/openhuman-core/src/agent/` (model + autonomy), `crates/openhuman-core/src/channels/` (provider tokens), `crates/openhuman-core/src/memory/` (storage paths), `crates/openhuman-core/src/cron/` (scheduler poll), `crates/openhuman-core/src/inference/local/` (Ollama / device routing), `crates/openhuman-core/src/security/` (sandbox backend, autonomy policy), `crates/openhuman-core/src/voice/`, `crates/openhuman-core/src/desktop/notifications/`, `crates/openhuman-core/src/tools/`.
-- `crates/openhuman-core/src/core/all.rs` — registers `all_config_*`.
+- `crates/openhuman-core/src/core/all.rs` — registers `all_config_registered_controllers()` under `DomainGroup::Config`.
+- `crates/openhuman-core/src/tools/mod.rs` — `pub use crate::config::tools::*` re-exports the read-only config tools.
## Tests
- Unit: `ops_tests.rs` (+ `ops_tests_part_0N_tests.rs`), `schemas_tests.rs`, plus per-section `*_tests.rs` under `schema/` (`channels_tests.rs`, `proxy_tests.rs`, etc.) and `load_tests.rs` (+ `load_tests_part_0N_tests.rs`).
-- Cross-test serialization: `schema/load/impl_load.rs` round-trips against `schema/defaults.rs`.
- `TEST_ENV_LOCK` (`mod.rs`) is shared with sibling test modules that mutate `OPENHUMAN_WORKSPACE`.
diff --git a/crates/openhuman-core/src/integrations/README.md b/crates/openhuman-core/src/integrations/README.md
index 8c645a5c1a..9b846e4027 100644
--- a/crates/openhuman-core/src/integrations/README.md
+++ b/crates/openhuman-core/src/integrations/README.md
@@ -17,10 +17,15 @@ task-source sub-domains, and the remaining non-search tool families.
- Own the [`file_storage`](file_storage/README.md) managed cloud file-storage tool family as a child module.
- Classify transport and user-state failures through `core::observability::report_error_or_expected`.
-Every request `IntegrationClient` sends to the TinyHumans backend carries a
-sanitized `x-sdk-name` (see `ProductIdentity` handling in `client_part_01.rs`
-and `client_tests.rs::product_identity_seen_by_backend`), per AGENTS.md
-"Backend API".
+Every request `IntegrationClient` sends through the `tinyhumans-sdk` client
+carries the sanitized `x-sdk-name` product identity
+(`crate::api::product::product_identity_headers()` applied via
+`with_default_headers` in `client_part_01.rs`; asserted by
+`integration_requests_carry_the_default_product_identity` in
+`client_tests_part_01_tests.rs`). The one deliberate exception, per AGENTS.md
+"Backend API", is `get_bytes`: it uses a separate untagged `download_client`
+because the file-storage download route answers a 302 to a presigned S3 URL
+and reqwest keeps custom headers across the cross-host redirect.
## Members
@@ -28,23 +33,11 @@ and `client_tests.rs::product_identity_seen_by_backend`), per AGENTS.md
| --- | --- |
| `client.rs` + `client_part_01.rs` / `client_part_02.rs` | `IntegrationClient`: `post`/`get`/`get_bytes`/`patch`/`delete`/`upload_multipart`/`pricing`, backend URL sanitization, and client construction. |
| `types.rs` | Shared serde types for backend envelopes and pricing. |
-| `tools.rs` | Non-search, non-connector agent tools: Google Places, stock/market data, Twilio. |
+| `tools.rs` + `tools/` | Non-search, non-connector agent tools: `tools/google_places.rs` (search + details), `tools/stock_prices.rs` (quote, exchange rate, options, crypto series, commodity via backend financial APIs), `tools/twilio.rs` (outbound calls). `tools.rs` only declares and re-exports them. |
| [`file_storage/`](file_storage/README.md) | Managed cloud file-storage agent tools (`Storage*Tool`), backed by the backend's S3-based `file_storage` provider. |
| [`composio/`](composio/README.md) | Composio connector integration: catalogs, connections, triggers, direct-auth fallback, and the `tinyconnectors` module bridge. |
| [`task_sources/`](task_sources/README.md) | Normalizes external task feeds (via the Composio providers) into agent-facing list/fetch/filter tools. |
-| `test_support.rs` + `test_support_backend.rs` | In-process fake integration backend (`spawn_fake_integration_backend`) used by `tools/ops_tests_part_02_tests.rs` / `ops_tests_part_03_tests.rs` to exercise integration tools without a real backend. |
-
-## Key Files
-
-| File | Role |
-| --- | --- |
-| `crates/openhuman-core/src/integrations/mod.rs` | Export-only module root. Declares the `client`, `composio`, `file_storage`, `task_sources`, `tools`, `types` submodules; re-exports `build_client`, `pricing_for_config`, `IntegrationClient`, pricing/envelope types. |
-| `crates/openhuman-core/src/integrations/client.rs` | `IntegrationClient` construction and top-level methods; split across `client_part_01.rs` / `client_part_02.rs`. |
-| `crates/openhuman-core/src/integrations/types.rs` | Shared serde types for backend envelopes and pricing. |
-| `crates/openhuman-core/src/integrations/tools.rs` | Aggregates and re-exports the non-search, non-connector tool modules. |
-| `crates/openhuman-core/src/integrations/tools/google_places.rs` | Google Places search + details. |
-| `crates/openhuman-core/src/integrations/tools/stock_prices.rs` | Market data via backend financial APIs. |
-| `crates/openhuman-core/src/integrations/tools/twilio.rs` | Outbound phone calls via backend Twilio. |
+| `test_support.rs` + `test_support_backend.rs` | In-process axum fake of the integration backend (`spawn_fake_integration_backend`, records every request). Not a `mod` of this module: `tools/ops_tests.rs` pulls it in with `#[path = "../integrations/test_support.rs"]` for `ops_tests_part_02_tests.rs` / `ops_tests_part_03_tests.rs`. |
## Search Boundary
diff --git a/crates/openhuman-core/src/util/tls/README.md b/crates/openhuman-core/src/util/tls/README.md
index daccc5ce74..dc31e4c4f6 100644
--- a/crates/openhuman-core/src/util/tls/README.md
+++ b/crates/openhuman-core/src/util/tls/README.md
@@ -19,21 +19,8 @@ Platform-conditional TLS backend selection for `reqwest` HTTP clients. A single
- `tls_client_builder() -> reqwest::ClientBuilder` — returns a `reqwest::Client::builder()` with `.use_native_tls()` on Windows and `.use_rustls_tls()` elsewhere, selected at compile time via `cfg`. Intended as the starting point for any client reaching external HTTPS endpoints; callers chain `.timeout(...)`, `.http1_only()`, proxy config, etc. and then `.build()`.
-## RPC / controllers
-
-None. Not RPC-facing — no `schemas.rs`, no controllers.
-
-## Agent tools
-
-None.
-
-## Events
-
-None.
-
-## Persistence
-
-None — stateless, pure factory.
+No RPC surface, agent tools, bus events, or persistence — a stateless
+factory.
## Dependencies
@@ -49,7 +36,7 @@ Every HTTP-client construction site that talks to external HTTPS endpoints, incl
- `crates/openhuman-core/src/desktop/app_state/ops_part_01.rs`.
- `crates/openhuman-core/src/api/rest.rs` (REST API client).
-Registered in the domain tree via `pub mod tls;` in `crates/openhuman-core/src/util/mod.rs`.
+Declared via `pub mod tls;` in `crates/openhuman-core/src/util/mod.rs`; not re-exported at the `util` root, so callers spell `crate::util::tls::tls_client_builder`.
## Notes / gotchas
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge.rs b/crates/openhuman-core/src/web_chat/progress_bridge.rs
index 088e4e3a82..e432dda077 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge.rs
@@ -1,7 +1,7 @@
//! Forwards a running turn's `AgentProgress` stream into `WebChannelEvent`
//! socket events and mirrors it into `TurnStateStore`. Also emits the
//! `inference_heartbeat` liveness beat (see [`INFERENCE_HEARTBEAT_SECS`])
-//! so a long silent prefill can't trip the frontend's disconnect timer.
+//! so a long silent prefill can't trip the frontend's ~120s silence timeout.
use serde_json::json;