Skip to content

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

docs(openhuman-embed): document public api tests

Steven Enamakel07fee0f2b412
diff --git a/crates/openhuman-embed/README.md b/crates/openhuman-embed/README.md
index 1fe3e87ff8..7f0bc58322 100644
--- a/crates/openhuman-embed/README.md
+++ b/crates/openhuman-embed/README.md
@@ -30,6 +30,24 @@ tools that spawn independent tasks or processes must provide their own cleanup;
MCP server lifecycles remain owned by the agent. Keep polling `send()` while
awaiting cancellation, for example in a spawned task.
+## Steering one turn
+
+Acquire `Turn::steering_handle()` before sending a turn to add messages to it
+while it runs. The handle is cloneable and `Send + Sync`; `steer(text)` queues
+a user message that the agent loop applies at its next safe checkpoint:
+before the first model call, after a tool batch has settled, or when the model
+has just written its final answer. In that last case the draft stays on the
+transcript, the steer follows it, and the model is called once more, so a
+message that arrives during a plain chat turn's only model call still shapes
+that turn's reply. Nothing interrupts a model call or a tool already running.
+The model sees each steer as `[User steering message]: <text>`.
+
+Nothing is dropped silently. Steers the turn ended without applying come back
+on `TurnOutcome::unapplied_steers`, or from `TurnSteering::take_unapplied()`
+when the turn failed or was cancelled. A steer sent after the turn ended is
+refused with `SteerRefused`, which carries its text (`into_text()`). The host
+decides whether to run what came back as the next turn.
+
## Scoped worker hooks
Hooks can be supplied at three levels: `RuntimeBuilder::tool_hook` /
diff --git a/crates/openhuman-embed/tests/README.md b/crates/openhuman-embed/tests/README.md
index 5a9b5639c5..f25f70ed9d 100644
--- a/crates/openhuman-embed/tests/README.md
+++ b/crates/openhuman-embed/tests/README.md
@@ -48,6 +48,7 @@ record types preserve populated persisted JSON, including metadata and lineage.
| [`turn_observers.rs`](turn_observers.rs) | Terminal error privacy, explicit input capture, and exactly one terminal callback on dispatch failure. |
| [`observed_turns.rs`](observed_turns.rs) | Actual model and host-tool observations survive the core runtime task hop; payloads require consent; actual model, finish reason and reasoning usage. |
| [`public_api.rs`](public_api.rs) | Compile-time check that the host-facing types and signatures stay exported. |
+| [`turn_steering.rs`](turn_steering.rs) | A steer sent during a plain chat turn's only model call is applied after the draft answer and earns one more call in the same turn; a steer queued before send reaches the first call; a steer after the turn ended is refused with its text; a cancelled turn hands an undelivered steer back. |
| [`turn_cancellation.rs`](turn_cancellation.rs) | Cancellation before send, during inference and during a builtin shell command; repeated requests and agent reuse. |
| [`process_cancellation.rs`](process_cancellation.rs) | On Linux, dropping a command future kills its shell descendants. |
| `inline_permissions.rs` | An inline UI decision precedes execution; concurrent agents and one-turn denials stay isolated. |
diff --git a/crates/openhuman-embed/tests/public_api.rs b/crates/openhuman-embed/tests/public_api.rs
index 1d09e095a1..68374ff298 100644
--- a/crates/openhuman-embed/tests/public_api.rs
+++ b/crates/openhuman-embed/tests/public_api.rs
@@ -38,6 +38,23 @@ fn exposes_the_host_facing_embedding_contract() {
fn removes_agent<'a>(runtime: &'a Runtime, id: &str) -> RemoveAgent<'a> {
runtime.remove_agent(id).purge()
}
+ fn steers_a_turn(
+ turn: &mut openhuman_embed::Turn,
+ ) -> Result<openhuman_embed::TurnSteering, openhuman_embed::SteerRefused> {
+ let steering = turn.steering_handle();
+ steering.steer("one more thing")?;
+ Ok(steering)
+ }
+ fn hands_back_steers(
+ steering: &openhuman_embed::TurnSteering,
+ outcome: &openhuman_embed::TurnOutcome,
+ refused: openhuman_embed::SteerRefused,
+ ) -> Vec<String> {
+ let mut left = outcome.unapplied_steers.clone();
+ left.extend(steering.take_unapplied());
+ left.push(refused.into_text());
+ left
+ }
fn lifecycle_errors(error: &AgentError) -> Option<usize> {
match error {
AgentError::AgentLimit { limit } => Some(*limit),
@@ -48,6 +65,8 @@ fn exposes_the_host_facing_embedding_contract() {
}
let _ = accepts_core;
+ let _ = steers_a_turn;
+ let _ = hands_back_steers;
let _ = accepts_builder;
let _ = accepts_runtime;
let _ = accepts_harness;