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
refactor(orchestration): remove agent teams runtime
Steven Enamakelfed516689b0d
diff --git a/app/scripts/e2e-run-all-flows.sh b/app/scripts/e2e-run-all-flows.shindex 433a080468..2c13ab7d47 100755--- a/app/scripts/e2e-run-all-flows.sh+++ b/app/scripts/e2e-run-all-flows.sh@@ -270,7 +270,6 @@ if should_run_suite "chat"; thenrun "test/e2e/specs/chat-background-activity-panel.spec.ts" "chat-background-activity" "chat"run "test/e2e/specs/chat-todos-goals.spec.ts" "chat-todos-goals" "chat"run "test/e2e/specs/agent-harness-behaviors.spec.ts" "agent-harness-behaviors" "chat"- run "test/e2e/specs/agent-teams-live.spec.ts" "agent-teams-live" "chat"run "test/e2e/specs/file-drop-guard.spec.ts" "file-drop-guard" "chat"run "test/e2e/specs/chat-external-link.spec.ts" "chat-external-link" "chat"run "test/e2e/specs/mega-flow.spec.ts" "mega-flow" "chat"diff --git a/crates/openhuman-core/src/agent/harness/fork_context.rs b/crates/openhuman-core/src/agent/harness/fork_context.rsindex cd0168cc8c..d460d93cbe 100644--- a/crates/openhuman-core/src/agent/harness/fork_context.rs+++ b/crates/openhuman-core/src/agent/harness/fork_context.rs@@ -6,7 +6,7 @@//! [`crate::agent::OpenHumanSessionHost`] attaches it to its turn's//! [`OpenHumanRunContext`](crate::agent::tinyagents::host::OpenHumanRunContext)//! (`parent`), tools read it from there, and controller-spawned background-//! surfaces (the workflow engine, agent teams) build a root one with+//! surfaces (such as the workflow engine) build a root one with//! [`crate::agent::orchestration::parent_context::with_root_parent`] and pass it//! to the spawns they make. There is no ambient copy.//!diff --git a/crates/openhuman-core/src/agent/orchestration/mod.rs b/crates/openhuman-core/src/agent/orchestration/mod.rsindex e8ee855c8c..70e99aea62 100644--- a/crates/openhuman-core/src/agent/orchestration/mod.rs+++ b/crates/openhuman-core/src/agent/orchestration/mod.rs@@ -6,8 +6,7 @@//! construction, tool filtering, and the actual sub-agent run loop.//!//! Execution fans out on TinyAgents **graphs**: [`workflow_runs`] schedules-//! phase DAGs on a graph engine, [`agent_teams`] runs members through a-//! conditional-routing graph, [`delegation`] wires the durable+//! phase DAGs on a graph engine, [`delegation`] wires the durable//! plan→execute⇄review→finalize graph, and parallel fanout goes through//! `tinyagents_graph::parallel::map_reduce`. What stays here is the product//! layer: durable SQL/JSON run ledgers, validation, cancellation semantics,@@ -15,7 +14,6 @@//! [`running_subagents`] mirrors detached-sub-agent lifecycle into a//! TinyAgents task store.-pub mod agent_teams;pub(crate) mod background_completions;pub(crate) mod background_delivery;pub(crate) mod busy_guard;diff --git a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rsindex 004d8e2063..ec919e0c0f 100644--- a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs+++ b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs@@ -1,11 +1,10 @@//! Shared root [`ParentExecutionContext`] builder for controller-spawned//! orchestration tasks (#3374 PR4, extracted from the #3375 workflow engine).//!-//! The workflow-run engine ([`workflow_runs::engine`]) and the agent-team-//! runtime ([`agent_teams::runtime`]) both need to spawn real sub-agents from a-//! background task that has **no** enclosing agent turn on the stack, so there is-//! no live parent execution context for the spawn to inherit — a naive spawn-//! fails with `NoParentContext` (the TAURI-RUST-HMW regression, #4337).+//! The workflow-run engine ([`workflow_runs::engine`]) needs to spawn real+//! sub-agents from a background task that has **no** enclosing agent turn on the+//! stack, so there is no live parent execution context for the spawn to inherit —+//! a naive spawn fails with `NoParentContext` (the TAURI-RUST-HMW regression, #4337).//!//! The fix (proven in `triage::escalation::dispatch_target_agent`) is to build a//! *root* [`ParentExecutionContext`] from a config-built [`Agent`] and hand it,@@ -40,10 +39,10 @@ const LOG_TARGET: &str = "agent_orchestration::parent_context";/// running sub-agents without an enclosing agent turn. The caller supplies the/// identity fields that distinguish one orchestration surface from another:///-/// - `agent_definition_id` — labels the root parent (e.g. `"workflow_engine"`,-/// `"agent_team_runtime"`); surfaced in spawn metadata / logs.+/// - `agent_definition_id` — labels the root parent (e.g. `"workflow_engine"`);+/// surfaced in spawn metadata / logs./// - `channel` — the logical channel the spawned work belongs to (e.g.-/// `"workflow"`, `"team"`).+/// `"workflow"`)./// - `session_prefix` — the `session_id` is `"{session_prefix}-{uuid}"`, keeping/// each surface's sessions namespaced and greppable.///diff --git a/crates/openhuman-core/src/agent_runs/mod.rs b/crates/openhuman-core/src/agent_runs/mod.rsindex c28603aa28..224d12d72a 100644--- a/crates/openhuman-core/src/agent_runs/mod.rs+++ b/crates/openhuman-core/src/agent_runs/mod.rs@@ -1,6 +1,5 @@-//! Product-facing RPC surfaces for agent runs, teams, workflows, replay, and tools.+//! Product-facing RPC surfaces for agent runs, workflows, replay, and tools.-pub(crate) mod agent_teams;pub(crate) mod command_center;pub(crate) mod context_breakdown;pub(crate) mod replay;@@ -10,9 +9,6 @@ mod subagent_finalize;pub(crate) mod workflow_runs;pub(crate) mod worktree_schemas;-pub(crate) use agent_teams::{- all_agent_team_controller_schemas, all_agent_team_registered_controllers,-};pub(crate) use command_center::{all_command_center_controller_schemas, all_command_center_registered_controllers,};@@ -40,7 +36,6 @@ pub(crate) fn all_orchestration_registered_controllers(let mut controllers = Vec::new();controllers.extend(all_command_center_registered_controllers());controllers.extend(all_workflow_run_registered_controllers());- controllers.extend(all_agent_team_registered_controllers());controllers.extend(all_worktree_registered_controllers());controllers.extend(all_subagent_control_registered_controllers());controllers@@ -51,7 +46,6 @@ pub(crate) fn all_orchestration_controller_schemas() -> Vec<crate::core::Controllet mut schemas = Vec::new();schemas.extend(all_command_center_controller_schemas());schemas.extend(all_workflow_run_controller_schemas());- schemas.extend(all_agent_team_controller_schemas());schemas.extend(all_worktree_controller_schemas());schemas.extend(all_subagent_control_controller_schemas());schemasdiff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rsindex 930a24ea58..4cdf5470fa 100644--- a/crates/openhuman-core/src/core/all.rs+++ b/crates/openhuman-core/src/core/all.rs@@ -845,9 +845,6 @@ pub fn namespace_description(namespace: &str) -> Option<&'static str> {"workflow_run" => Some("Durable dynamic workflow runs — declarative multi-agent definitions and the read surface over persisted runs.",),- "agent_team" => Some(- "Durable agent-team coordination: teams, members, dependency-aware task claiming, and teammate messaging.",- ),"tool_registry" => Some("Read-only discovery for MCP stdio tools and controller-backed tools, including routes, schemas, version, allowed agents, and health.",),diff --git a/docs/gitbooks/en/developing/architecture/agent-harness.md b/docs/gitbooks/en/developing/architecture/agent-harness.mdindex 6f839bf73b..8cab7d0a68 100644--- a/docs/gitbooks/en/developing/architecture/agent-harness.md+++ b/docs/gitbooks/en/developing/architecture/agent-harness.md@@ -100,7 +100,6 @@ Multi-agent orchestration runs on the tinyagents graph layer, through `tinyagent- [`orchestration/delegation.rs`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/agent/orchestration/delegation.rs) is a `plan → execute ⇄ review → finalize` `CompiledGraph`. It has conditional routing, `RecursionPolicy`, a durable `FileCheckpointer`, a `CancellationToken` and a `GraphTracingSink`.- The workflow phase engine fans each phase's agents out on the graph (`with_max_concurrency`). The durable `WorkflowRun` ledger stays the source of truth for resume.- `spawn_parallel_agents` runs its fan-out through the host `spawn_parallel` adapter over `tinyagents_orchestration::parallel`.-- The agent-teams member runtime is a conditional-routing graph (`execute → complete | fail → done`, [`agent_teams/runtime.rs`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs)).- The detached-sub-agent registry is backed by a typed `TaskStore` lifecycle ledger (Pending, Running, then Completed, Failed or Cancelled).## TinyAgents crate: features and compatibility@@ -111,7 +110,7 @@ OpenHuman depends on the split TinyAgents 2.1 crate family by path into the vend- `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)).- 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 durability → OpenHuman SQL/JSON run ledgers (`running_subagents`, `workflow_runs`, `agent_teams`, `command_center`). The generic harness/graph/middleware/event primitives are used as-is.+- Ownership map: model construction → `inference::provider::create_chat_model*`; durable graph checkpoints → TinyAgents' `SqliteCheckpointer`; generic detached executor state → `DetachedTaskRegistry`; controller-facing durability → OpenHuman SQL/JSON run ledgers (`running_subagents`, `workflow_runs`, `command_center`). The generic harness/graph/middleware/event primitives are used as-is.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.@@ -654,7 +653,6 @@ direct `tinyagents-orchestration::subagent` lifecycle. There is noOrchestration on graphs (`crates/openhuman-core/src/agent/orchestration/`):- Workflow phase DAG (`workflow_runs/engine.rs`) runs on a `dispatch ⇄ run_phase → done` conditional-routing graph; each phase fans its agents out via `graph::parallel::map_reduce`. The durable `workflow_runs` row stays the source of truth (controllers + resume read it).-- Team member runtime (`agent_teams/runtime.rs`, `run_member_graph`) is a conditional-routing graph (`execute → complete|fail → done`).- Multi-stage delegation (`orchestration::delegation` + the `delegate` tool) runs `delegation.rs`, checkpointed to the session DB.- Detached sub-agents (`running_subagents.rs`) use TinyAgents `DetachedTaskRegistry` for ownership-aware snapshots, wait/timeout, steering lookup, cooperative cancellation, hard abort, and terminal cleanup. OpenHuman retains durable task-store projection, product/session metadata, RPC and delivery semantics, and the `RunQueue` compatibility fallback.@@ -666,7 +664,7 @@ Deliberately kept off the crate's primitives (these are design decisions, not gaproduct checkpoint/session projection. It implements the TinyAgentsplanner/executor/persistence traits directly. The neutral driver, not ahost-local runner, owns lifecycle sequencing and task-key coalescing.-- Durable run ledgers (`workflow_runs`, `agent_teams`, `command_center`, `subagent_sessions`) stay on openhuman SQLite/JSON until their controller projections and restart semantics are mapped onto TinyAgents task/status/journal records. The `agent_teams` race-safe SQL compare-and-swap task claim remains OpenHuman-owned.+- Durable run ledgers (`workflow_runs`, `command_center`, `subagent_sessions`) stay on openhuman SQLite/JSON until their controller projections and restart semantics are mapped onto TinyAgents task/status/journal records.> 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/scripts/ci/agent-runtime-boundary-baseline.json b/scripts/ci/agent-runtime-boundary-baseline.jsonindex 3caaf2c4dc..e8a596b7c2 100644--- a/scripts/ci/agent-runtime-boundary-baseline.json+++ b/scripts/ci/agent-runtime-boundary-baseline.json@@ -6,20 +6,6 @@"text": "let outcome = turn_origin::with_origin(","occurrence": 1},- {- "rule": "openhuman-task-local",- "path": "crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs",- "line": 191,- "text": "let inherited_origin = crate::agent::turn_origin::capture();",- "occurrence": 1- },- {- "rule": "openhuman-task-local",- "path": "crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs",- "line": 193,- "text": "crate::agent::turn_origin::with_inherited_origin(",- "occurrence": 1- },{"rule": "openhuman-task-local","path": "crates/openhuman-core/src/agent/orchestration/ops.rs",