Skip to content

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

docs(agent): update harness docs for tinyagents spawn depth

Steven Enamakelc28b28c4eda0
diff --git a/crates/openhuman-core/src/agent/README.md b/crates/openhuman-core/src/agent/README.md
index 2ce842511c..edc538af36 100644
--- a/crates/openhuman-core/src/agent/README.md
+++ b/crates/openhuman-core/src/agent/README.md
@@ -207,7 +207,7 @@ The child gets a filtered tool list (the definition's `tools`,
cheaper model. Its progress shows up on the parent's channel as
`SubagentSpawned`, `SubagentToolCallStarted`, `SubagentTextDelta` and the
other `Subagent*` variants. Spawn depth is capped by
-`harness::MAX_SPAWN_DEPTH`. Detached runs are tracked through TinyAgents'
+`tinyagents::budget::MAX_SPAWN_DEPTH`. Detached runs are tracked through TinyAgents'
`DetachedTaskRegistry` and can be steered through the shared
`SteeringRegistry` ([`tinyagents/host/steering.rs`](./tinyagents/host/steering.rs)).
diff --git a/crates/openhuman-core/src/agent/harness/README.md b/crates/openhuman-core/src/agent/harness/README.md
index 892bd41634..cfce9a0ef9 100644
--- a/crates/openhuman-core/src/agent/harness/README.md
+++ b/crates/openhuman-core/src/agent/harness/README.md
@@ -25,7 +25,8 @@ used here (not defined here) by [`fork_context.rs`](./fork_context.rs).
traits directly. This module does not export a compatibility runner of its
own.
- Carry the task-local plumbing that lets a spawned tool see its parent's
- runtime context (`fork_context.rs`, [`spawn_depth_context.rs`](./spawn_depth_context.rs)).
+ runtime context (`fork_context.rs`). Recursion facts come from TinyAgents’
+ public run context, including depth imported over MCP.
Sandbox mode is carried explicitly by `OpenHumanRunContext` into the typed
tool execution context.
- Run the channel/CLI turn graph ([`graph.rs`](./graph.rs)); all sub-agents use
@@ -39,7 +40,7 @@ used here (not defined here) by [`fork_context.rs`](./fork_context.rs).
| Module | Role |
| --- | --- |
| `definition*.rs`, [`builtin_definitions.rs`](./builtin_definitions.rs), [`definition_loader.rs`](./definition_loader.rs) | `AgentDefinition`/`AgentDefinitionRegistry`/`SandboxMode`/`ToolScope`/`PromptSource`/`ModelSpec`; loads built-ins from `crate::agent::registry::agents` and user TOML from the workspace/home `agents/` directory. |
-| `fork_context.rs`, `spawn_depth_context.rs` | Task-locals that let a spawned tool see its parent's runtime context: parent handle and spawn depth. `fork_context.rs` also carries the `RunQueue` handle (from `tinyagents_harness::run_queue`) down to a forked turn. |
+| `fork_context.rs` | Parent-handle context for direct host dispatch. `fork_context.rs` also carries the `RunQueue` handle (from `tinyagents_harness::run_queue`) down to a forked turn. |
| `graph.rs` | `run_channel_turn_via_graph` (`pub(crate)`): the channel/CLI turn graph, thin over `run_turn_via_tinyagents_shared`; called by the `agent.run_turn` native-bus handler in [`agent/bus.rs`](../bus.rs). |
| `artifact_offload/` | The `outputs/` / `workspace/` convention under `action_dir`: prompt half (`contract.rs`) and host policy half (`policy.rs`); mechanics (thresholds, path resolution, pointer rendering, the writer) live in `tinyagents_harness::artifacts` and are re-exported here. |
| `tool_result_artifacts/` | Wiring only: `new_tool_result_store` hands `tinyagents_harness::artifacts::tool_results` OpenHuman's redactor (`SanitizingRedactor`), `file_read`/`use_skill` names and `FileReadTool::MAX_FILE_SIZE_BYTES`. The store, `[tool_result_preview]` envelope, budgets and paged reads live in the crate. |
@@ -81,7 +82,9 @@ turn lifecycle are in `../session_host/`; `run_subagent`,
bundles loaded by `definition_loader`/`builtin_definitions`.
- `crate::security::SecurityPolicy`: workspace containment policy plumbed
into `artifact_offload::new_artifact_offload`.
-- `crate::memory`: trust-tier wrapping (`memory_context_safety`) and text
+- `tinymemory-api`: provenance classification and untrusted-context wrapping,
+ configured with connector prefixes from `memory::provenance`.
+- `crate::memory`: text
sanitization (`artifact_offload::SanitizingRedactor` wraps `memory::safety::sanitize_text` for both artifact stores).
- `crate::config::AgentConfig`, `crate::skills::Workflow`,
`crate::tools::{Tool, ToolSpec}`: runtime context carried through
diff --git a/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs b/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs
index 201becc203..9bb2d518cb 100644
--- a/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs
+++ b/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs
@@ -226,7 +226,7 @@ pub struct AgentDefinition {
/// * `{ skills = "*" }` entries admit no sub-agent, so they are always
/// allowed.
///
- /// Combined with the harness's `MAX_SPAWN_DEPTH = 3` task-local
+ /// Combined with the host's `MAX_SPAWN_DEPTH = 3` policy
/// gate, this means any execution chain bottoms out within three
/// hops: `chat → reasoning → worker` (or `chat → worker` for the
/// fast path).
diff --git a/crates/openhuman-core/src/agent/harness/definition/tier.rs b/crates/openhuman-core/src/agent/harness/definition/tier.rs
index 3d1c86affc..2f3f6e1f4d 100644
--- a/crates/openhuman-core/src/agent/harness/definition/tier.rs
+++ b/crates/openhuman-core/src/agent/harness/definition/tier.rs
@@ -71,7 +71,7 @@ impl std::fmt::Display for AgentTier {
///
/// Note this forbids same-tier and worker-as-parent hops, **not** upward hops:
/// `reasoning → chat` is a legal edge (a reasoning agent can hand a follow-up
-/// back to the `orchestrator` chat agent), so it must stay allowed. The harness'es `MAX_SPAWN_DEPTH` cap bounds chain length
+/// back to the `orchestrator` chat agent), so it must stay allowed. The host's `MAX_SPAWN_DEPTH` cap bounds chain length
/// independently of tier direction.
///
/// This is the static authoring rule the loader walks over declared `subagents`
diff --git a/scripts/ci/check-openhuman-rust-layout.mjs b/scripts/ci/check-openhuman-rust-layout.mjs
index 2c91ba4f3b..8050a97bc0 100644
--- a/scripts/ci/check-openhuman-rust-layout.mjs
+++ b/scripts/ci/check-openhuman-rust-layout.mjs
@@ -47,7 +47,7 @@ const LEGACY_LIMIT_ENTRIES = [
// a follow-up without reintroducing an old harness/session exception.
["crates/openhuman-core/src/agent/session_host/builder/factory.rs", 973],
["crates/openhuman-core/src/agent/subagent_host/lifecycle.rs", 1247],
- ["crates/openhuman-core/src/agent/subagent_host/ops/runner.rs", 1062],
+ ["crates/openhuman-core/src/agent/subagent_host/ops/runner.rs", 1046],
["crates/openhuman-core/src/tools/ops.rs", 883],
["crates/openhuman-core/src/web_chat/progress_bridge.rs", 1264],
// These established external test modules grew with upstream coverage. Pin