Skip to content

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

docs: update agent architecture documentation

Steven Enamakel5187347cd2f3
diff --git a/crates/openhuman-core/src/agent/tinyagents/README.md b/crates/openhuman-core/src/agent/tinyagents/README.md
index 721ed571d2..149f153118 100644
--- a/crates/openhuman-core/src/agent/tinyagents/README.md
+++ b/crates/openhuman-core/src/agent/tinyagents/README.md
@@ -10,7 +10,7 @@ The adapter seam between OpenHuman and the vendored [`tinyagents`](../../../../.
- Route workloads to model tiers and record the resolved provider/model for audit ([`routes.rs`](./routes.rs), canonical TinyInference response metadata).
- Let TinyAgents stop repetitive visible model streams in its agent loop; the OpenHuman session driver turns `GenerationStalled` into a bounded partial containing completed tool evidence.
- Make turns durable and replayable: a JSONL event journal plus status store ([`journal.rs`](./journal.rs)), a startup sweep for orphaned runs ([`reaper.rs`](./reaper.rs)), and a read-only RPC surface over both (`replay/`).
-- Provide graph-layer helpers for multi-stage sub-agent orchestration (`orchestration.rs`, `delegation.rs`) (graph structure export lives in `tinyagents_orchestration::topology`).
+- Adapt TinyAgents' generic async sub-agent lifecycle to OpenHuman's actor context, execution policy, and product projections.
- Pick which tools a turn even considers: `discovery/` holds the process-wide tool-search ranker slot (see [Tool search](#tool-search) below).
- Host adapters (`host/`) for the crate's ten host-capability traits. Not yet wired into the live turn path; see [Host adapters](#host-adapters) below.
diff --git a/docs/gitbooks/en/developing/architecture/agent-harness.md b/docs/gitbooks/en/developing/architecture/agent-harness.md
index e9c4922591..83b7c84077 100644
--- a/docs/gitbooks/en/developing/architecture/agent-harness.md
+++ b/docs/gitbooks/en/developing/architecture/agent-harness.md
@@ -104,10 +104,10 @@ the generic task lifecycle.
OpenHuman depends on the split TinyAgents 2.1 crate family by path into the vendored git submodule `vendor/tinyagents`, `tinyagents-harness` (features `sqlite`, `multimodal`, `builtin-tools`), `tinyagents-definition`, `tinyagents-graph` (`sqlite`), `tinyagents-registry`, `tinyagents-session`, `tinyagents-runtime`, `tinyagents-orchestration` and the optional `tinyagents-live`, plus `tinyinference` from `vendor/tinyagents/vendor/tinyinference`, so SDK changes can be tested in-tree before they go upstream (see [`crates/openhuman-core/Cargo.toml`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/Cargo.toml)). The reasons, so future upgrades do not regress it:
- Native TinyAgents model interface, OpenHuman-owned product policy. Every live route is an `Arc<dyn ChatModel<()>>`: TinyAgents OpenAI-compatible clients cover wire-equivalent managed, local, and BYOK routes, while host `ChatModel` implementations cover Claude SDK/Code and Codex-specific transports. OpenHuman still owns credential resolution, OAuth, access gates, endpoint selection, egress disclosure, billing metadata, and error classification.
-- `sqlite` feature enabled with one native sqlite chain. OpenHuman's root and Tauri Cargo worlds pin `rusqlite = "=0.40.2"` (`bundled`); the pinned Rust 1.96 toolchain provides the `cfg_select!` macro its build script needs. Both worlds resolve to a single `libsqlite3-sys` chain. Durable graph checkpoints run through TinyAgents' own `SqliteCheckpointer` (see [`orchestration/delegation.rs`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/agent/orchestration/delegation.rs)).
+- `sqlite` feature enabled with one native sqlite chain. OpenHuman's root and Tauri Cargo worlds pin `rusqlite = "=0.40.2"` (`bundled`); the pinned Rust 1.96 toolchain provides the `cfg_select!` macro its build script needs. Both worlds resolve to a single `libsqlite3-sys` chain. Durable sub-agent task state uses TinyAgents' generic lifecycle persistence.
- WhatsApp Web storage bridge. `whatsapp-rust`'s Diesel-backed `sqlite-storage` feature links sqlite separately from rusqlite 0.40, so the optional `whatsapp-web` feature (forwarded to `tinychannels/whatsapp-web`) builds against `wacore::store::InMemoryBackend` and logs that sessions are not durable. Web sessions stay non-persistent until a rusqlite-backed durable WhatsApp store exists.
- No scripting runtime. There is no `repl` or Rhai scripting feature and no `rhai_workflows` tool. Rhai still appears as a dependency of `tinyflows` for its own JSON-query stack, unrelated to the agent harness.
-- Ownership map: model construction → `inference::provider::create_chat_model*`; durable graph checkpoints → TinyAgents' `SqliteCheckpointer`; generic detached executor state → `DetachedTaskRegistry`; controller-facing projections → OpenHuman sub-agent sessions and command center. TinyAgents provides the generic harness, graph, middleware, and event primitives.
+- Ownership map: model construction → `inference::provider::create_chat_model*`; durable sub-agent task state → TinyAgents' lifecycle persistence; generic detached executor state → `DetachedTaskRegistry`; controller-facing projections → OpenHuman sub-agent sessions. TinyAgents provides the generic harness, middleware, and event primitives.
The agent harness is the runtime that turns a user message (or a webhook fire, or a cron tick) into a complete, tool-using LLM interaction. It owns the tool-call loop, sub-agent dispatch, the trigger-triage pipeline, and the hook surface around them. It does not own provider HTTP transport, tool implementations, prompt-section assembly or memory storage. Those are separate domains the harness composes.
@@ -657,7 +657,7 @@ Deliberately kept off the crate's primitives (these are design decisions, not ga
product checkpoint/session projection. It implements the TinyAgents
planner/executor/persistence traits directly. The neutral driver, not a
host-local runner, owns lifecycle sequencing and task-key coalescing.
-- Command-center and sub-agent-session projections remain host-owned; generic detached task lifecycle is owned by TinyAgents.
+- Sub-agent-session projections remain host-owned; generic detached task lifecycle is owned by TinyAgents.
> TinyAgents ships harness store/cache/session primitives (`harness::store` with JSONL append stores, `harness::cache`, `harness::subagent`, lineage-aware status), graph task stores, the detached runtime registry, and conformance contracts. The session shell and product-specific sub-agent build/delivery pipeline remain OpenHuman-owned.
diff --git a/docs/gitbooks/en/developing/architecture/security.md b/docs/gitbooks/en/developing/architecture/security.md
index aa5347f0fd..8c3b5bab3c 100644
--- a/docs/gitbooks/en/developing/architecture/security.md
+++ b/docs/gitbooks/en/developing/architecture/security.md
@@ -98,7 +98,7 @@ Local PII detection belongs to [`tinymemory_api::safety`](https://github.com/tin
- `crates/openhuman-core/src/tools/ops.rs` and `tools/impl/{browser,document,filesystem,network,presentation,system}/`: every executable tool consults `SecurityPolicy`.
- `crates/openhuman-core/src/tools/impl/network/{gate,mcp,mcp_server_tools}.rs`: risk-classify outbound calls.
- `crates/openhuman-core/src/memory/guard.rs`: wraps every memory write in `security::scrub::host_policy()`.
-- `crates/openhuman-core/src/tools/delegate.rs`: sub-agent dispatch goes through the autonomy gate.
+- `crates/openhuman-core/src/agent/subagent_host/`: sub-agent execution applies the host's tool policy and autonomy gate.
- `crates/openhuman-core/src/security/credentials/`: uses `SecretStore` and `redact`.
## Tests
diff --git a/docs/gitbooks/en/developing/architecture/storage.md b/docs/gitbooks/en/developing/architecture/storage.md
index 9131bf1ddf..32bf20f2bf 100644
--- a/docs/gitbooks/en/developing/architecture/storage.md
+++ b/docs/gitbooks/en/developing/architecture/storage.md
@@ -158,7 +158,7 @@ Every storage test target runs the same body once per driver, and each run is a
| `sqlite`, `file` | When `storage-sqlite` or `storage-file` is compiled in, on temp directories |
| `mongodb` | When `storage-mongodb` is compiled in and `TSD_MONGO_URL` is set. Each case uses a database of its own. |
-The targets are `storage_approvals_e2e`, `storage_domains_e2e`, `storage_flows_e2e`, `storage_secrets_e2e`, `storage_scope_e2e`, `storage_agent_scopes_e2e`, `storage_delegation_e2e` and `cli_storage_url_e2e`. Run one locally with the drivers you want:
+The targets are `storage_approvals_e2e`, `storage_domains_e2e`, `storage_flows_e2e`, `storage_secrets_e2e`, `storage_scope_e2e`, `storage_agent_scopes_e2e` and `cli_storage_url_e2e`. Run one locally with the drivers you want:
```bash
cargo test -p openhuman-cli --features storage-sqlite,storage-file --test storage_approvals_e2e
diff --git a/docs/gitbooks/en/features/native-tools/agent-coordination.md b/docs/gitbooks/en/features/native-tools/agent-coordination.md
index e3c9f11d3a..095dba0c48 100644
--- a/docs/gitbooks/en/features/native-tools/agent-coordination.md
+++ b/docs/gitbooks/en/features/native-tools/agent-coordination.md
@@ -16,7 +16,6 @@ Besides doing the work, the agent has tools for organizing it: planning multi-st
| `spawn_async_subagent` | A lower-level reusable async delegation tool with the same durable session identity. |
| `steer_subagent`, `wait_subagent` | Message or collect a running worker by durable `subagent_session_id` or transient `task_id`. |
| `list_subagents`, `close_subagent` | Inspect the reusable workers for the parent thread, or retire one. |
-| `delegate` | Hands a task to a specialist, such as an archetype with different prompts, tools or permissions. |
| `use_skill` | Loads an inline skill's playbook and tools (coding, web3, system, scheduling, docs, mcp) so the agent can call them. |
| `ask_user_clarification` | Pauses and asks you a precise question instead of guessing. |
| `plan_exit` | Leaves the planning phase and starts executing. |