The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs: update documentation regarding agent execution models
Steven Enamakel712e594d487c
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.mdindex 1ded3df8b8..3846491060 100644--- a/docs/TEST-COVERAGE-MATRIX.md+++ b/docs/TEST-COVERAGE-MATRIX.md@@ -225,7 +225,7 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an| 4.4.5 | Approval Gate — TTL Timeout | RI | `tests/agent_harness_e2e.rs` | ✅ | `OPENHUMAN_APPROVAL_TTL_SECS` (debug-only) → no decision → auto-deny || 4.4.6 | Subagent + Approval Gate | RI | `tests/agent_harness_e2e.rs` | ✅ | Approval fires inside subagent context; decision propagates; artifact content asserted || 4.4.7 | Multi-turn State Persistence | RI+RU | `tests/agent_harness_e2e.rs`, `crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs::a_cold_resumed_thread_can_send_again`, `crates/openhuman-core/src/agent/session_host/transcript_compat_tests.rs` | ✅ | Turn-2 request carries turn-1 history; a cold host resumes the committed thread and accepts another turn (#6608). Historical tool results replay after executor retirement; a missing executor recovers as an unknown-tool response without restoring execution authority (#7410) |-| 4.4.8 | Parallel Subagent Fan-out | RI | `tests/agent_harness_e2e.rs` | ✅ | `spawn_parallel_agents` 2-task fan-out; both child results reach synthesis call |+| 4.4.8 | Concurrent Async Subagent Tasks | RI | `tests/agent_harness_e2e.rs` | ✅ | Independent async sub-agent runs can overlap and both results reach the parent || 4.4.9 | Max Iterations / Empty Response | RI | `tests/agent_harness_e2e.rs` | ✅ | Tool-call limit surface + empty-completion graceful terminal (both skip Sentry) || 4.4.10 | Provider Error Retry | RI | `tests/agent_harness_e2e.rs` | ✅ | First upstream 500 retried by ReliableProvider; second succeeds || 4.4.11 | Inference Phase Transitions | WD | `app/test/e2e/specs/agent-harness-behaviors.spec.ts` | ✅ | Redux `inferenceStatusByThread` observes `subagent` phase then clears to idle |diff --git a/docs/gitbooks/en/developing/architecture/agent-harness.md b/docs/gitbooks/en/developing/architecture/agent-harness.mdindex 71f4434f1a..e9c4922591 100644--- a/docs/gitbooks/en/developing/architecture/agent-harness.md+++ b/docs/gitbooks/en/developing/architecture/agent-harness.md@@ -95,9 +95,9 @@ runtime-wide".Every agent turn runs through the published [`tinyagents`](https://crates.io/crates/tinyagents) harness. There are three entry points: `Agent::turn`, the channel and CLI bus path, and `run_subagent`. All of them go through the adapter seam in [`crates/openhuman-core/src/agent/tinyagents/`](https://github.com/tinyhumansai/openhuman/tree/main/crates/openhuman-core/src/agent/tinyagents) (`TurnSpec::run`). Context trimming is `MessageTrimMiddleware`, and cancellation is the tinyagents steering channel. Policy stop hooks (budget, thread-goal and iteration caps) use the upstream `tinyagents-hooks` `StopHookMiddleware` and pause the run on the first stop vote. The channel route forwards live `AgentProgress` like the chat route. The shared `TurnProgress` seam lives in `agent/session_host/tool_progress.rs`.-Multi-agent execution uses TinyAgents' `parallel` module and the host-`spawn_parallel_agents` adapter. Detached sub-agent tasks retain host policy,-progress, and product projections; TinyAgents owns the generic task lifecycle.+Concurrent work uses separate async sub-agent requests. Detached sub-agent+tasks retain host policy, progress, and product projections; TinyAgents owns+the generic task lifecycle.## TinyAgents crate: features and compatibility@@ -201,7 +201,7 @@ Measure this rather than reasoning about it. `CAPTURE_ALL=1 node scripts/debug/cAlongside identity/soul/profile/memory, the system prompt pulls in AGENTS.md instruction files, OpenHuman's analog of Claude Code's `CLAUDE.md` / Codex's `AGENTS.md`. Two layers are loaded once, at system-prompt build time (never re-read per turn, so the frozen-prefix / KV-cache contract holds):- Global, `<workspace_dir>/AGENTS.md`, the user's OpenHuman workspace (where `SOUL.md` / `USER.md` live). Applies to every run.-- Project, `<action_dir>/AGENTS.md`, the folder the agent is operating in. For sub-agent runs with a git-worktree override (`SubagentRunOptions.worktree_action_dir`), that override dir is the project layer instead.+- Project, `<action_dir>/AGENTS.md`, the folder the agent is operating in.The global layer renders first, the project layer second (project instructions layered after, taking precedence on conflict), under a `## Project instructions (AGENTS.md)` heading. When the two dirs resolve to the same path the file is loaded once (deduped). Missing / unreadable / empty files are silently skipped, and each layer is capped at `BOOTSTRAP_MAX_CHARS` (~20 000 chars) with a `[... truncated]` marker so a large file can't crowd the prompt.@@ -559,7 +559,7 @@ New/extended socket events (bridged from `DomainEvent` onto `WebChannelEvent` by- `approval_decided` / `plan_review_decided`: bridged from `DomainEvent::ApprovalDecided` / `PlanReviewDecided`, which gained `thread_id`, `client_id`, `tool_call_id`, and `resolution` (`"expired"` on TTL/sweep, `"cancelled"` on a dropped decision channel, `None` for an ordinary user decision, carried on the wire as the existing `cancel_reason` field). Only surfaced when the original park had both `thread_id` and `client_id` (chat-routed).- `run_mode_changed`: `{ thread_id, client_id: "", message: "plan" | "build" }`, bridged from `DomainEvent::ThreadRunModeChanged`, published by `threads::run_mode::set_mode`.- `thread_todos_changed`, `queue_item_queued` / `queue_item_delivered` / `queue_item_removed`, `queue_item` carries `{ id, lane, text_preview }`.-- Sub-agent correlation: `subagent_spawned`/`subagent_completed`/`subagent_failed`/`subagent_awaiting_user` carry `subagent.parent_call_id` (the spawning tool call's id: every worker of one `spawn_parallel_agents` call shares it); `subagent_completed` also carries `subagent.output` (capped final text). `tool_call.args`/`tool_result.args`+`elapsed_ms` now carry real arguments and timing instead of `null` (from tinyagents' `AgentEvent::ToolStarted.input`).+- Sub-agent correlation: `subagent_spawned`/`subagent_completed`/`subagent_failed`/`subagent_awaiting_user` carry `subagent.parent_call_id` (the spawning tool call's id); `subagent_completed` also carries `subagent.output` (capped final text). `tool_call.args`/`tool_result.args`+`elapsed_ms` now carry real arguments and timing instead of `null` (from tinyagents' `AgentEvent::ToolStarted.input`).- Artifact events (`ArtifactPending`/`ArtifactReady`/`ArtifactFailed`) carry `tool_call_id` and `turn_request_id`, the latter filled from the originating turn's `ApprovalChatContext::request_id` so the frontend can bind an artifact card to the exact turn that produced it (`None` for CLI/cron/sub-agent producers with no chat context).New RPCs:@@ -647,8 +647,7 @@ direct `tinyagents-orchestration::subagent` lifecycle. There is no| `delegation.rs` | The durable `plan → execute ⇄ review → finalize` delegation graph (production worker wired in `orchestration::delegation`), checkpointed via TinyAgents' own `SqliteCheckpointer`. |Orchestration in `crates/openhuman-core/src/agent/orchestration/` adapts-detached sub-agent execution, worktree isolation, progress, and product-projections. TinyAgents owns generic task lifecycle and parallel fanout.+detached sub-agent execution, progress, and product projections. TinyAgents owns generic task lifecycle and parallel fanout.Deliberately kept off the crate's primitives (these are design decisions, not gaps):diff --git a/docs/gitbooks/en/developing/architecture/frontend.md b/docs/gitbooks/en/developing/architecture/frontend.mdindex de270f37de..97b91b3db8 100644--- a/docs/gitbooks/en/developing/architecture/frontend.md+++ b/docs/gitbooks/en/developing/architecture/frontend.md@@ -428,7 +428,7 @@ are not separately exported components from the npm runtime package.| Queued follow-ups | `ComposerPrimitive.Queue`, `QueueItemPrimitive.Text`, `Remove` | Core run-queue adapter and translated registry row captions || Markdown, code and citations | `MarkdownTextPrimitive` and registry elements | Source projection, app links, math and artifact access || Reasoning and tool groups | `MessagePrimitive.GroupedParts`, registry tool-group/reasoning elements | Core timing and grouping interleaved reasoning with calls |-| Tasks and subagents | Registry task-card/subagent-list, `ReadonlyThreadProvider` | Delegation state, awaiting-user replies and worktree actions |+| Tasks and subagents | Registry task-card/subagent-list, `ReadonlyThreadProvider` | Delegation state and awaiting-user replies || Approvals, questions and plans | Registry approval-card, elicitation-form and agent-plan | Core decision RPCs, security policy and plan/workflow lifecycle || Todos and goals | Registry todo-list and agent-status | Durable harness progress and remembered disclosure state || Images, documents and tool results | Registry image, artifact-card, web-search, terminal-block, code-diff and web-preview | Core artifact and tool-result projection |diff --git a/docs/gitbooks/en/features/native-tools/agent-coordination.md b/docs/gitbooks/en/features/native-tools/agent-coordination.mdindex a210cc5e2d..e3c9f11d3a 100644--- a/docs/gitbooks/en/features/native-tools/agent-coordination.md+++ b/docs/gitbooks/en/features/native-tools/agent-coordination.md@@ -17,12 +17,11 @@ Besides doing the work, the agent has tools for organizing it: planning multi-st| `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. |-| `spawn_parallel_agents` | Fans one task out to several specialists at once and merges what they return. || `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. |-`spawn_subagent` and archetype delegation calls accept an optional `model` field to pin an exact model for one call. If you leave it out, the harness uses per-agent pins from config when present, and otherwise falls back to normal model-routing hints. Model, sandbox mode, parent thread, action root and task key all affect whether a sub-agent can be reused, so materially different work gets its own worker.+`spawn_subagent` and archetype delegation calls accept an optional `model` field to pin an exact model for one call. If you leave it out, the harness uses per-agent pins from config when present, and otherwise falls back to normal model-routing hints. Model, sandbox mode, parent thread and task key all affect whether a sub-agent can be reused, so materially different work gets its own worker. For concurrent work, start several async sub-agent tasks and collect their results with `wait_subagent`.Reusable delegation returns a transient `task_id` and a durable `subagent_session_id`. Use the durable id for follow-ups in later turns. Pass `fresh: true` only when you or the task needs a clean worker. Pass `blocking: true` only when the parent must wait for the child's result.diff --git a/docs/library-minimal-recipe.md b/docs/library-minimal-recipe.mdindex 6b573578bb..2415902edf 100644--- a/docs/library-minimal-recipe.md+++ b/docs/library-minimal-recipe.md@@ -193,7 +193,7 @@ build-fact error:- **tui:** `openhuman tui` / `chat` returns "tui feature disabled at compile time".Everything the opencompany use cases need remains: the agent harness + turn-runner, subagent delegation (`spawn_parallel_agents`), the Memory v2 host+runner, subagent delegation, the Memory v2 host(engine binding, sources, conversations, context + secret/PII scrubbing), threads, config,security policy, provider routing/inference, `skills` (SKILL.md discovery/installdiff --git a/docs/specs/agent-runtime-upstream-boundary.md b/docs/specs/agent-runtime-upstream-boundary.mdindex cdfd5b8841..82d6a1a11c 100644--- a/docs/specs/agent-runtime-upstream-boundary.md+++ b/docs/specs/agent-runtime-upstream-boundary.md@@ -162,8 +162,7 @@ ToolResult shape. Harness-only correlation (`call_id`, elapsed time, run id)belongs to an internal invocation record/event, not the tool result.`AgentHarness::register_tool` accepts `Arc<dyn tinytools::Tool>`. A recursive-canonical tool that needs its typed parent (for example OpenHuman's-`spawn_parallel_agents`) uses `AgentHarness::register_tool_dispatch` and an+canonical tool that needs its typed parent (for example OpenHuman's recursive delegation tools) uses `AgentHarness::register_tool_dispatch` and anexplicit `ToolDispatch<State, Ctx>` instead of recovering state from atask-local. The harnessimplements its execution context as `tinytools::ToolRunContext` and performs@@ -253,8 +252,7 @@ Callers use registry types directly; OpenHuman does not re-export them.Generic delegation state machines, recursive run lifecycle, steering registry,topology export, and todo selection are `tinyagents-graph` responsibilities.-OpenHuman retains workflow RPC/domain decisions, worktree creation policy,-delivery, durable product ledgers, and graph-event projection.+OpenHuman retains workflow RPC/domain decisions, delivery, durable product ledgers, and graph-event projection.Do not add `tinyagents-inspect` during the initial migration. Diagnostics canbe added as a separate crate later if multiple consumers need a stable@@ -279,7 +277,7 @@ all consumers import the owner directly, not that behavior is dropped.| `harness/` | Split then shrink | Move generic definitions, recursion, parsing, filtering, graph and loop helpers to TinyAgents; keep public OpenHuman session facade only until live callers use the crate harness, then replace it with host construction/routing. || `learning/` | Keep | Product learning/profile policy behind `LearningSink`. Generic post-turn callback timing moves to harness. || `library/` | Keep | Product-facing safe definition projection/RPC DTO. |-| `orchestration/` | Split | Move generic graph lifecycle/delegation/selection; keep worktrees, workflow business rules, delivery, RPC, ledgers, and host tools. |+| `orchestration/` | Split | Move generic graph lifecycle/delegation/selection; keep workflow business rules, delivery, RPC, ledgers, and host tools. || `plan_review/` | Keep | OpenHuman interactive approval policy and RPC state. || `profiles/` | Delete | Removed in this migration; agent definitions come from the registry. || `progress_tracing.rs`, `progress_tracing/` | Keep | OpenHuman UI/Langfuse projection and transport. Generic observations/events remain upstream. |