Skip to content

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

refactor(hooks): update hook crate paths to tinyagents_hooks

Steven Enamakel6334c8f5f761
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 5619e2c1ea..ae4d4171a5 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -251,7 +251,7 @@ pub(crate) async fn run_subagent_direct(
// forbids never reaches a user script, and before config load so a
// denied spawn has no side effects at all.
if let Err(reason) = crate::hooks::ops::subagent_starting(
- tinyagents_runtime::command_hooks::context::TurnIdentity {
+ tinyagents_hooks::command::context::TurnIdentity {
conversation_id: Some(parent.session_id.clone()),
session_id: Some(parent.session_id.clone()),
agent_id: Some(parent.agent_definition_id.clone()),
diff --git a/crates/openhuman-core/src/agent/tinyagents/README.md b/crates/openhuman-core/src/agent/tinyagents/README.md
index 2faeec2f91..393ccd938e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/README.md
+++ b/crates/openhuman-core/src/agent/tinyagents/README.md
@@ -32,7 +32,7 @@ The adapter seam between OpenHuman and the vendored [`tinyagents`](../../../../.
| `replay/` | Read-only agent-run replay/status RPC (`mod.rs`, `ops.rs`, `schemas.rs`): three `agent`-namespace controllers; `ops.rs` is a workspace adapter over `tinyagents_harness::observability::replay`. |
| `journal.rs` | `TurnJournal` and `attach_turn_journal`: a crate `StoreEventJournal` over a JSONL append store plus a `HarnessStatusStore` writer (`FileStatusStore`, `mint_run_id` and the env-secret redaction seed are upstream in `tinyagents_harness::observability`) under `{workspace}/tinyagents_store`. Attached alongside the live `observability` bridge as an independent `EventSink` subscriber, wrapped in `RedactingSink`; best-effort and non-fatal. |
| `reaper.rs` | `reap_orphaned_runs`: workspace adapter over the upstream sweep (`tinyagents_harness::observability::reap_orphaned_runs`) that marks non-terminal runs `Cancelled` in the durable status store. The only writer over the status seam that `replay/` reads. |
-| [`middleware.rs`](./middleware.rs) + `middleware/` | The named OpenHuman middleware stack. `turn_context.rs`: `TurnContextMiddleware` (bundles config and installs the enabled hooks), `TranscriptSnapshotMiddleware`/`TranscriptSnapshotSink`. `tool_output.rs`: `ToolOutputMiddleware` (per-result byte cap and optional payload summarizer). `approval.rs`: `ApprovalSecurityMiddleware`. `tool_policy.rs`: the `ToolPolicyMiddleware` struct and impl (records blocks into `crate::tools::registry::denials`). `tool_outcome_capture.rs`: `ToolOutcomeCaptureMiddleware`. `embedder_hooks.rs`: `EmbedderToolHooksMiddleware`. `memory_protocol.rs`: the OpenHuman tool vocabulary (`memory_protocol_spec()`) for the upstream `MemoryProtocolMiddleware`. `cost_budget.rs`: `CostBudgetMiddleware`. `repeated_failure.rs`: `RepeatedToolFailureMiddleware` (class-specific recovery budgets before the next model call; equivalent failures share a stable resource scope even when arguments differ). `loop_guards.rs`: `TerminalInferenceFailure`. `credential_scrub.rs`: the browser confirmation-token exemption and `credential_scrub_middleware()`, which wires the harness `CredentialScrubMiddleware`. The generic context-ladder and loop-guard middleware live in `tinyagents-harness` (`middleware::library`) and are installed by [`context_wiring.rs`](./context_wiring.rs) / `harness_assembly.rs`: `ImageAwareMessageTrimMiddleware`, `FinalCallWrapUpMiddleware` (host passes the `file_write`/`apply_patch` deliverable tools and `CLEARED_PLACEHOLDER`), `ArtifactIndexTocMiddleware` (issue #6014), `RepeatProgressMiddleware`/`RepeatEvictionObserver` (host passes the `wait_subagent` exemption), and `ArgRecoveryMiddleware`. |
+| [`middleware.rs`](./middleware.rs) + `middleware/` | The named OpenHuman middleware stack. `turn_context.rs`: `TurnContextMiddleware` (bundles config and installs the enabled hooks), `TranscriptSnapshotMiddleware`/`TranscriptSnapshotSink`. `tool_output.rs`: `ToolOutputMiddleware` (per-result byte cap and optional payload summarizer). `approval.rs`: `ApprovalSecurityMiddleware`. `tool_policy.rs`: the `ToolPolicyMiddleware` struct and impl (records blocks into `crate::tools::registry::denials`). `tool_outcome_capture.rs`: `ToolOutcomeCaptureMiddleware`. `memory_protocol.rs`: the OpenHuman tool vocabulary (`memory_protocol_spec()`) for the upstream `MemoryProtocolMiddleware`. `cost_budget.rs`: `CostBudgetMiddleware`. `repeated_failure.rs`: `RepeatedToolFailureMiddleware` (class-specific recovery budgets before the next model call; equivalent failures share a stable resource scope even when arguments differ). `loop_guards.rs`: `TerminalInferenceFailure`. `credential_scrub.rs`: the browser confirmation-token exemption and `credential_scrub_middleware()`, which wires the harness `CredentialScrubMiddleware`. The generic context-ladder and loop-guard middleware live in `tinyagents-harness` (`middleware::library`) and are installed by [`context_wiring.rs`](./context_wiring.rs) / `harness_assembly.rs`: `ImageAwareMessageTrimMiddleware`, `FinalCallWrapUpMiddleware` (host passes the `file_write`/`apply_patch` deliverable tools and `CLEARED_PLACEHOLDER`), `ArtifactIndexTocMiddleware` (issue #6014), `RepeatProgressMiddleware`/`RepeatEvictionObserver` (host passes the `wait_subagent` exemption), and `ArgRecoveryMiddleware`. |
| [`middleware/research_budget.rs`](./middleware/research_budget.rs) | Withdraws the web tools from a top-level turn after eight successful search or fetch calls (forcing an answer only when no other tool remains), and notes once when consecutive web calls fail. |
| `model.rs` | Helpers and wrappers over native crate `ChatModel` values: message/response translation, usage merging, stream-delta forwarding, `MaxTokensModel`, `ProfileOverrideModel`. |
| [`tools.rs`](./tools.rs) | `CanonicalSharedToolAdapter`: resolves an OpenHuman shared tool registry and forwards the canonical `tinytools::Tool` contract; `EarlyExitHook` pauses successful `ask_user_clarification`-style calls. |
diff --git a/crates/openhuman-core/src/config/schema/hooks.rs b/crates/openhuman-core/src/config/schema/hooks.rs
index 4f207a0b62..adc3026420 100644
--- a/crates/openhuman-core/src/config/schema/hooks.rs
+++ b/crates/openhuman-core/src/config/schema/hooks.rs
@@ -2,7 +2,7 @@
//!
//! The hooks themselves are **not** configured here. They live in `hooks.json`
//! files discovered across four layers
-//! (`tinyagents_runtime::command_hooks::config`), because a hook set belongs with the
+//! (`tinyagents_hooks::command::config`), because a hook set belongs with the
//! repository it guards and has to be readable by a human who has never seen
//! this config file. This block only carries the decisions that belong to the
//! host: whether the system runs at all, and how long a hook that names no
diff --git a/crates/openhuman-core/src/web_chat/ops/start_chat.rs b/crates/openhuman-core/src/web_chat/ops/start_chat.rs
index 36e30ad665..8251e45ff4 100644
--- a/crates/openhuman-core/src/web_chat/ops/start_chat.rs
+++ b/crates/openhuman-core/src/web_chat/ops/start_chat.rs
@@ -319,7 +319,7 @@ async fn start_chat_inner(
// The message here is post-attachment-processing, so a hook sees extracted
// text and placeholders rather than a multi-megabyte data URI on stdin.
match crate::hooks::ops::prompt_submitted(
- tinyagents_runtime::command_hooks::context::TurnIdentity {
+ tinyagents_hooks::command::context::TurnIdentity {
conversation_id: Some(thread_id.clone()),
..Default::default()
},