Skip to content

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

docs(agent): document typed cancellation dispatch

Steven Enamakelaea75ce54cb7
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
index afd9c36a25..9f8f846e35 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
@@ -182,7 +182,7 @@ impl ChatModel<()> for BlockingFanoutModel {
}
}
-/// The live harness does not recover cancellation from a task-local. Its typed
+/// The live harness does not recover ambient cancellation. Its typed
/// dispatch receives the parent `RunContext`, so a token cancelled while a
/// child worker is in flight stops the fan-out at its worker safe point with
/// the same workspace grant.
diff --git a/docs/specs/agent-runtime-upstream-boundary.md b/docs/specs/agent-runtime-upstream-boundary.md
index fb143e7cd1..24ae7f1745 100644
--- a/docs/specs/agent-runtime-upstream-boundary.md
+++ b/docs/specs/agent-runtime-upstream-boundary.md
@@ -328,7 +328,7 @@ all consumers import the owner directly, not that behavior is dropped.
| `payload_summarizer.rs`, `summarize.rs` | Move generic summarizer orchestration/trait to harness; OpenHuman model selection/config adapter stays. |
| `turn_policy.rs`, `turn_outcome.rs`, `turn_run_error.rs`, `turn_run_finalize.rs` | Move generic run policy/outcome/finalization upstream; retain product error/progress/cost projection only. |
| `turn_models.rs`, remaining `routes.rs` | Keep as `ModelResolver` implementation/config projection, then relocate under the host adapter rather than an integration facade. |
-| `thread_context.rs`, `stop_hooks.rs`, `steering_forwarder.rs` | Replace with explicit run/child context; keep only product stop-hook adapter. The former cancellation task-local is deleted: recursive fan-out receives the parent token through typed tool dispatch. |
+| `thread_context.rs`, `stop_hooks.rs`, `steering_forwarder.rs` | Replace with explicit run/child context; keep only product stop-hook adapter. The former ambient cancellation carrier is deleted: recursive fan-out receives the parent token through typed tool dispatch. |
| `orchestration.rs`, `delegation.rs`, `topology.rs` | Move generic lifecycle/helpers to graph; keep product topology composition only where it genuinely names product graphs. |
| `observability/*` | Keep OpenHuman projection (`AgentProgress`, cost, Langfuse); move reusable graph/event/cap mechanics upstream and import directly. |
| `journal.rs`, `reaper.rs`, `replay/*` | Keep because layout/RPC are product durability contracts; use upstream journal traits directly. |
diff --git a/gitbooks/developing/architecture/agent-harness.md b/gitbooks/developing/architecture/agent-harness.md
index 0317252059..876cf2ce20 100644
--- a/gitbooks/developing/architecture/agent-harness.md
+++ b/gitbooks/developing/architecture/agent-harness.md
@@ -351,7 +351,7 @@ When the orchestrator calls `spawn_subagent`, the default contract is durable an
The child run itself still uses the same runner:
-1. Reads the parent's execution context from a task-local - the parent's provider, sandbox mode, cancellation fence, transcript root.
+1. Receives parent cancellation and workspace from its typed run context; remaining legacy provider, sandbox, and transcript inputs stay scoped until their explicit migration lands.
2. Resolves the sub-agent's model - inline `model` override first, then config-level pins (`[orchestrator].model`, `[teams.*].lead_model`, `[teams.*].agent_model`), then the archetype hint or inherited parent model.
3. Filters the parent's tool registry per the definition's `tools`, `disallowed_tools`, and `skill_filter`. In `fork` mode, the parent's full registry is inherited verbatim.
4. Builds a narrow system prompt, omitting the sections the definition asks to strip.
@@ -500,7 +500,7 @@ assembly and middleware registry consume that typed context directly. Route,
and thread scopes still surround the drive only for legacy tool/model APIs
outside the typed harness boundary. Recursive fan-out receives cancellation and
workspace from its typed parent `RunContext` through `ToolDispatch`; it never
-reads a cancellation task-local.
+reads ambient cancellation state.
`OpenHumanHostBundleFactory` is the B1 host composition point. It constructs
the context, definition, security, model, memory, budget, progress, learning,