Skip to content

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

chore: migrate from `tinyagents` to `tinyagents_harness` crate

Steven Enamakel922b74a1f8fc
diff --git a/src/bin/library_profile/mock.rs b/src/bin/library_profile/mock.rs
index c3b011051b..e7ca2a55d5 100644
--- a/src/bin/library_profile/mock.rs
+++ b/src/bin/library_profile/mock.rs
@@ -319,7 +319,7 @@ impl ChatModel<()> for SubagentMock {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(model_response(
self.dispatch(&joined_request(&request)).await,
))
@@ -376,7 +376,7 @@ impl ChatModel<()> for LatencyMock {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.latency.sleep_sampled().await;
let joined = joined_request(&request);
record(&self.prompts, &joined);
@@ -406,7 +406,7 @@ impl ChatModel<()> for PlainTextMock {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let joined = joined_request(&request);
record(&self.prompts, &joined);
Ok(model_response(response(&self.text)))
@@ -492,7 +492,7 @@ impl ChatModel<()> for SkillRunMock {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(model_response(self.reply(&joined_request(&request))))
}
}
diff --git a/src/bin/rss_bench.rs b/src/bin/rss_bench.rs
index e9ecd02693..2babcec342 100644
--- a/src/bin/rss_bench.rs
+++ b/src/bin/rss_bench.rs
@@ -64,7 +64,7 @@ impl ChatModel<()> for MockModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant("ok"))
}
}
diff --git a/src/openhuman/agent/agent_tests.rs b/src/openhuman/agent/agent_tests.rs
index 454280938d..a7c497831e 100644
--- a/src/openhuman/agent/agent_tests.rs
+++ b/src/openhuman/agent/agent_tests.rs
@@ -74,7 +74,7 @@ impl ChatModel<()> for ScriptedProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let mut guard = self.responses.lock().unwrap();
let response = if guard.is_empty() {
ChatResponse {
@@ -103,8 +103,8 @@ impl ChatModel<()> for FailingProvider {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
- Err(tinyagents::TinyAgentsError::Model(
+ ) -> tinyagents_harness::Result<ModelResponse> {
+ Err(tinyagents_harness::TinyAgentsError::Model(
"provider error".to_string(),
))
}
diff --git a/src/openhuman/agent/harness/session/runtime_tests.rs b/src/openhuman/agent/harness/session/runtime_tests.rs
index b2eb22e577..888aa74582 100644
--- a/src/openhuman/agent/harness/session/runtime_tests.rs
+++ b/src/openhuman/agent/harness/session/runtime_tests.rs
@@ -25,7 +25,7 @@ impl ChatModel<()> for StaticModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let response = self.response.lock().take().unwrap_or_else(|| {
Ok(ChatResponse {
text: Some("done".into()),
@@ -40,11 +40,11 @@ impl ChatModel<()> for StaticModel {
&response, &request,
),
),
- Err(error) => Err(tinyagents::TinyAgentsError::Model(error.to_string())),
+ Err(error) => Err(tinyagents_harness::TinyAgentsError::Model(error.to_string())),
}
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
let response = self.invoke(state, request).await?;
Ok(Box::pin(futures::stream::iter(vec![
ModelStreamItem::Started,
@@ -92,8 +92,8 @@ impl ChatModel<()> for PersistentErrModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
- Err(tinyagents::TinyAgentsError::Model(
+ ) -> tinyagents_harness::Result<ModelResponse> {
+ Err(tinyagents_harness::TinyAgentsError::Model(
self.build_error().to_string(),
))
}
diff --git a/src/openhuman/agent/harness/session/session_tests.rs b/src/openhuman/agent/harness/session/session_tests.rs
index baa68a9ecf..9d973e5830 100644
--- a/src/openhuman/agent/harness/session/session_tests.rs
+++ b/src/openhuman/agent/harness/session/session_tests.rs
@@ -37,7 +37,7 @@ impl ChatModel<()> for MockProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let mut guard = self.responses.lock();
let response = if guard.is_empty() {
ChatResponse {
@@ -56,7 +56,7 @@ impl ChatModel<()> for MockProvider {
)
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
let response = self.invoke(state, request).await?;
Ok(Box::pin(futures::stream::iter(vec![
ModelStreamItem::Started,
@@ -93,7 +93,7 @@ impl ChatModel<()> for RecordingProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let system_prompt = request.messages.iter().find_map(|message| match message {
Message::System(_) => Some(message.text()),
_ => None,
@@ -121,7 +121,7 @@ impl ChatModel<()> for RecordingProvider {
)
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
let response = self.invoke(state, request).await?;
Ok(Box::pin(futures::stream::iter(vec![
ModelStreamItem::Started,
@@ -360,16 +360,16 @@ impl crate::openhuman::agent::harness::session::transcript_history::SessionHisto
#[async_trait]
impl tinyagents_harness::memory::ChatHistory for FakeSessionHistory {
- async fn messages(&self, _thread_id: &str) -> tinyagents::Result<Vec<Message>> {
+ async fn messages(&self, _thread_id: &str) -> tinyagents_harness::Result<Vec<Message>> {
Ok(vec![])
}
- async fn append(&self, _thread_id: &str, _message: Message) -> tinyagents::Result<()> {
+ async fn append(&self, _thread_id: &str, _message: Message) -> tinyagents_harness::Result<()> {
Ok(())
}
- async fn replace(&self, _thread_id: &str, _messages: Vec<Message>) -> tinyagents::Result<()> {
+ async fn replace(&self, _thread_id: &str, _messages: Vec<Message>) -> tinyagents_harness::Result<()> {
Ok(())
}
- async fn clear(&self, _thread_id: &str) -> tinyagents::Result<()> {
+ async fn clear(&self, _thread_id: &str) -> tinyagents_harness::Result<()> {
Ok(())
}
}
diff --git a/src/openhuman/agent/harness/session/turn_tests.rs b/src/openhuman/agent/harness/session/turn_tests.rs
index a65fb1cad1..3131b4ac90 100644
--- a/src/openhuman/agent/harness/session/turn_tests.rs
+++ b/src/openhuman/agent/harness/session/turn_tests.rs
@@ -41,7 +41,7 @@ impl ChatModel<()> for DummyProvider {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant("unused"))
}
}
@@ -67,7 +67,7 @@ impl ChatModel<()> for SequenceProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.tool_counts.lock().await.push(request.tools.len());
self.requests.lock().await.push(
request
@@ -100,11 +100,11 @@ impl ChatModel<()> for SequenceProvider {
&response, &request,
),
),
- Err(error) => Err(tinyagents::TinyAgentsError::Model(error.to_string())),
+ Err(error) => Err(tinyagents_harness::TinyAgentsError::Model(error.to_string())),
}
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
// The legacy fixture implemented `chat` but did not write provider
// deltas. Preserve that non-streaming wire behavior: the harness still
// receives the authoritative completed response, while turn-owned
diff --git a/src/openhuman/agent/harness/subagent_runner/ops/graph_tests.rs b/src/openhuman/agent/harness/subagent_runner/ops/graph_tests.rs
index 1282721389..cbb9bfc201 100644
--- a/src/openhuman/agent/harness/subagent_runner/ops/graph_tests.rs
+++ b/src/openhuman/agent/harness/subagent_runner/ops/graph_tests.rs
@@ -67,7 +67,7 @@ impl ChatModel<()> for TwoStepProvider {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let n = self.calls.fetch_add(1, Ordering::SeqCst);
if n == 0 {
Ok(tool_response("1", "echo", serde_json::json!({"msg": "hi"})))
@@ -142,11 +142,11 @@ impl ChatModel<()> for ThinkingStreamProvider {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant("Hello"))
}
- async fn stream(&self, _state: &(), _request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, _state: &(), _request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
let response = ModelResponse::assistant("Hello");
Ok(Box::pin(futures::stream::iter(vec![
ModelStreamItem::Started,
@@ -281,7 +281,7 @@ impl ChatModel<()> for AskThenAnswer {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let n = self.calls.fetch_add(1, Ordering::SeqCst);
if n == 0 {
Ok(tool_response(
@@ -379,7 +379,7 @@ impl ChatModel<()> for LoopForeverProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
if !request.tools.is_empty() {
Ok(tool_response("n", "noop", serde_json::json!({})))
} else {
diff --git a/src/openhuman/agent/harness/subagent_runner/ops_tests.rs b/src/openhuman/agent/harness/subagent_runner/ops_tests.rs
index 268154aaf3..7687882c6d 100644
--- a/src/openhuman/agent/harness/subagent_runner/ops_tests.rs
+++ b/src/openhuman/agent/harness/subagent_runner/ops_tests.rs
@@ -153,11 +153,11 @@ impl ChatModel<()> for ScriptedProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(self.take_response(request))
}
- async fn stream(&self, _state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, _state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
let response = self.take_response(request);
let reasoning = response
.message
diff --git a/src/openhuman/agent/harness/tool_result_artifacts/mod.rs b/src/openhuman/agent/harness/tool_result_artifacts/mod.rs
index 6c81256df8..dca1dcb190 100644
--- a/src/openhuman/agent/harness/tool_result_artifacts/mod.rs
+++ b/src/openhuman/agent/harness/tool_result_artifacts/mod.rs
@@ -129,16 +129,16 @@ impl ToolResultArtifactIndexStore {
#[async_trait]
impl Store for ToolResultArtifactIndexStore {
- async fn get(&self, namespace: &str, key: &str) -> tinyagents::Result<Option<Value>> {
+ async fn get(&self, namespace: &str, key: &str) -> tinyagents_harness::Result<Option<Value>> {
let guard = self.data.lock().map_err(|_| {
- tinyagents::TinyAgentsError::Memory("tool artifact index poisoned".into())
+ tinyagents_harness::TinyAgentsError::Memory("tool artifact index poisoned".into())
})?;
Ok(guard.get(namespace).and_then(|ns| ns.get(key).cloned()))
}
- async fn put(&self, namespace: &str, key: &str, value: Value) -> tinyagents::Result<()> {
+ async fn put(&self, namespace: &str, key: &str, value: Value) -> tinyagents_harness::Result<()> {
let mut guard = self.data.lock().map_err(|_| {
- tinyagents::TinyAgentsError::Memory("tool artifact index poisoned".into())
+ tinyagents_harness::TinyAgentsError::Memory("tool artifact index poisoned".into())
})?;
guard
.entry(namespace.to_string())
@@ -147,9 +147,9 @@ impl Store for ToolResultArtifactIndexStore {
Ok(())
}
- async fn delete(&self, namespace: &str, key: &str) -> tinyagents::Result<()> {
+ async fn delete(&self, namespace: &str, key: &str) -> tinyagents_harness::Result<()> {
let mut guard = self.data.lock().map_err(|_| {
- tinyagents::TinyAgentsError::Memory("tool artifact index poisoned".into())
+ tinyagents_harness::TinyAgentsError::Memory("tool artifact index poisoned".into())
})?;
if let Some(ns) = guard.get_mut(namespace) {
ns.remove(key);
@@ -157,9 +157,9 @@ impl Store for ToolResultArtifactIndexStore {
Ok(())
}
- async fn list(&self, namespace: &str) -> tinyagents::Result<Vec<String>> {
+ async fn list(&self, namespace: &str) -> tinyagents_harness::Result<Vec<String>> {
let guard = self.data.lock().map_err(|_| {
- tinyagents::TinyAgentsError::Memory("tool artifact index poisoned".into())
+ tinyagents_harness::TinyAgentsError::Memory("tool artifact index poisoned".into())
})?;
Ok(guard
.get(namespace)
diff --git a/src/openhuman/agent/harness/turn_subagent_usage_tests.rs b/src/openhuman/agent/harness/turn_subagent_usage_tests.rs
index 5b79800d98..44a9d3eccd 100644
--- a/src/openhuman/agent/harness/turn_subagent_usage_tests.rs
+++ b/src/openhuman/agent/harness/turn_subagent_usage_tests.rs
@@ -45,7 +45,7 @@ async fn map_reduce_fanout_preserves_scope() {
.with_failure_policy(FailurePolicy::CollectAll),
|_index, (task_id, agent_id, usage)| async move {
record_subagent_usage(task_id, agent_id, usage);
- Ok::<_, tinyagents::TinyAgentsError>(task_id)
+ Ok::<_, tinyagents_harness::TinyAgentsError>(task_id)
},
)
.await
diff --git a/src/openhuman/agent/orchestration/agent_teams/graph.rs b/src/openhuman/agent/orchestration/agent_teams/graph.rs
index 7887ee6980..10a9316148 100644
--- a/src/openhuman/agent/orchestration/agent_teams/graph.rs
+++ b/src/openhuman/agent/orchestration/agent_teams/graph.rs
@@ -40,8 +40,8 @@ use crate::openhuman::agent::tinyagents::observability::GraphTracingSink;
/// Lift an injected effect's `anyhow` error into the graph's error type so it
/// fails the run (and propagates back out via [`run_member_execution_graph`]).
-fn graph_err(e: anyhow::Error) -> tinyagents::TinyAgentsError {
- tinyagents::TinyAgentsError::Graph(e.to_string())
+fn graph_err(e: anyhow::Error) -> tinyagents_harness::TinyAgentsError {
+ tinyagents_harness::TinyAgentsError::Graph(e.to_string())
}
/// Terminal classification of a teammate worker run, produced by the `execute`
diff --git a/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs b/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs
index 52ae1dc160..9d0d4fb643 100644
--- a/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs
+++ b/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs
@@ -97,9 +97,9 @@ impl ChatModel<()> for CannedModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
if self.fail {
- return Err(tinyagents::TinyAgentsError::Model(
+ return Err(tinyagents_harness::TinyAgentsError::Model(
"mock model forced failure".to_string(),
));
}
diff --git a/src/openhuman/agent/orchestration/command_center/control.rs b/src/openhuman/agent/orchestration/command_center/control.rs
index adafac761a..77f3580a3b 100644
--- a/src/openhuman/agent/orchestration/command_center/control.rs
+++ b/src/openhuman/agent/orchestration/command_center/control.rs
@@ -107,8 +107,8 @@ pub enum ControlError {
/// module's callers speak `anyhow`. Without this the `#[from] anyhow::Error`
/// variant does not apply, because `TinyAgentsError` is a distinct type — so
/// every ledger call in this file would need its own `map_err`.
-impl From<tinyagents::TinyAgentsError> for ControlError {
- fn from(err: tinyagents::TinyAgentsError) -> Self {
+impl From<tinyagents_harness::TinyAgentsError> for ControlError {
+ fn from(err: tinyagents_harness::TinyAgentsError) -> Self {
Self::Storage(err.into())
}
}
diff --git a/src/openhuman/agent/orchestration/delegation.rs b/src/openhuman/agent/orchestration/delegation.rs
index c8d2ed15ad..9c5cc6b0f4 100644
--- a/src/openhuman/agent/orchestration/delegation.rs
+++ b/src/openhuman/agent/orchestration/delegation.rs
@@ -29,7 +29,7 @@ use crate::openhuman::config::Config;
use tinyagents_graph::checkpoint::Checkpointer;
use tinyagents_graph::SqliteCheckpointer;
use tinyagents_harness::workspace::WorkspaceDescriptor;
-use tinyagents::CancellationToken;
+use tinyagents_harness::CancellationToken;
const LOG_TARGET: &str = "agent_orchestration::delegation";
diff --git a/src/openhuman/agent/orchestration/ops.rs b/src/openhuman/agent/orchestration/ops.rs
index 417e08e326..d34ae3e327 100644
--- a/src/openhuman/agent/orchestration/ops.rs
+++ b/src/openhuman/agent/orchestration/ops.rs
@@ -42,7 +42,7 @@ use crate::openhuman::agent::tinyagents::orchestration::{
use std::collections::BTreeMap;
use std::sync::Arc;
use thiserror::Error;
-use tinyagents::CancellationToken;
+use tinyagents_harness::CancellationToken;
use tokio::sync::{mpsc, watch};
use tokio::time::{Duration, Instant};
diff --git a/src/openhuman/agent/orchestration/ops_tests.rs b/src/openhuman/agent/orchestration/ops_tests.rs
index fa1784500c..b194340760 100644
--- a/src/openhuman/agent/orchestration/ops_tests.rs
+++ b/src/openhuman/agent/orchestration/ops_tests.rs
@@ -135,7 +135,7 @@ impl ChatModel<()> for CodingQuestionModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let flattened = request
.messages
.iter()
@@ -225,7 +225,7 @@ impl ChatModel<()> for ParallelCodingModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.state.calls.fetch_add(1, Ordering::SeqCst);
let current = self.state.active.fetch_add(1, Ordering::SeqCst) + 1;
self.record_peak(current);
@@ -439,7 +439,7 @@ impl ChatModel<()> for BlockingModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
tokio::time::sleep(Duration::from_secs(60)).await;
Ok(text_response("NEVER_REACHED"))
}
diff --git a/src/openhuman/agent/orchestration/running_subagents_part_01.rs b/src/openhuman/agent/orchestration/running_subagents_part_01.rs
index 162ac7815b..9206a8be27 100644
--- a/src/openhuman/agent/orchestration/running_subagents_part_01.rs
+++ b/src/openhuman/agent/orchestration/running_subagents_part_01.rs
@@ -16,7 +16,7 @@ use crate::openhuman::agent::tinyagents::orchestration::{
};
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::message::Message as TaMessage;
-use tinyagents::CancellationToken;
+use tinyagents_harness::CancellationToken;
/// Where a workspace's detached-task ledger lives.
///
diff --git a/src/openhuman/agent/orchestration/spawn_parallel_graph_part_02.rs b/src/openhuman/agent/orchestration/spawn_parallel_graph_part_02.rs
index f173251720..9804a2741d 100644
--- a/src/openhuman/agent/orchestration/spawn_parallel_graph_part_02.rs
+++ b/src/openhuman/agent/orchestration/spawn_parallel_graph_part_02.rs
@@ -582,7 +582,7 @@ async fn run_spawn_parallel_workers(
prepared: Vec<SpawnParallelWorker>,
action_root: Option<PathBuf>,
cancel: CancellationToken,
-) -> tinyagents::Result<Vec<ParallelAgentResult>> {
+) -> tinyagents_harness::Result<Vec<ParallelAgentResult>> {
let n = prepared.len();
let serial_write_count = prepared
.iter()
diff --git a/src/openhuman/agent/orchestration/spawn_parallel_graph_part_03.rs b/src/openhuman/agent/orchestration/spawn_parallel_graph_part_03.rs
index b37ffe0715..eb425887ed 100644
--- a/src/openhuman/agent/orchestration/spawn_parallel_graph_part_03.rs
+++ b/src/openhuman/agent/orchestration/spawn_parallel_graph_part_03.rs
@@ -182,7 +182,7 @@ enum SpawnParallelUpdate {
}
type SpawnParallelNodeFuture =
- Pin<Box<dyn Future<Output = tinyagents::Result<NodeResult<SpawnParallelUpdate>>> + Send>>;
+ Pin<Box<dyn Future<Output = tinyagents_harness::Result<NodeResult<SpawnParallelUpdate>>> + Send>>;
fn phase_node(
phase: &'static str,
diff --git a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs
index e9f1b17c8a..da0d1272e2 100644
--- a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs
+++ b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs
@@ -128,7 +128,7 @@ impl Tool for SpawnParallelAgentsTool {
tracing::debug!(
"[spawn_parallel_agents] no active tinyagents run cancellation token; using local token"
);
- tinyagents::CancellationToken::new()
+ tinyagents_harness::CancellationToken::new()
});
let outcome = run_spawn_parallel_graph_with_cancellation_and_workspace(
args,
diff --git a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents_tests.rs
index 0dc3392af0..b12f74e2db 100644
--- a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents_tests.rs
+++ b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents_tests.rs
@@ -322,7 +322,7 @@ impl ParallelHarnessProvider {
}
}
- async fn respond_for_subagent(&self, flattened: &str) -> tinyagents::Result<ModelResponse> {
+ async fn respond_for_subagent(&self, flattened: &str) -> tinyagents_harness::Result<ModelResponse> {
let current = self
.state
.active_subagent_calls
@@ -345,7 +345,7 @@ impl ParallelHarnessProvider {
sleep(Duration::from_millis(5)).await;
}
- let response = (|| -> tinyagents::Result<ModelResponse> {
+ let response = (|| -> tinyagents_harness::Result<ModelResponse> {
if flattened.contains(RESEARCH_PROMPT_CANARY) {
if flattened.contains("research-step-3-ok") {
Ok(text_response(RESEARCH_DONE_CANARY))
@@ -385,7 +385,7 @@ impl ParallelHarnessProvider {
))
}
} else {
- Err(tinyagents::TinyAgentsError::Model(format!(
+ Err(tinyagents_harness::TinyAgentsError::Model(format!(
"unexpected subagent payload: {flattened}"
)))
}
@@ -415,7 +415,7 @@ impl ChatModel<()> for ParallelHarnessProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.state.total_calls.fetch_add(1, Ordering::SeqCst);
let flattened = request
.messages
diff --git a/src/openhuman/agent/orchestration/tools/tools_e2e_tests.rs b/src/openhuman/agent/orchestration/tools/tools_e2e_tests.rs
index b225d250af..ace0ea27ab 100644
--- a/src/openhuman/agent/orchestration/tools/tools_e2e_tests.rs
+++ b/src/openhuman/agent/orchestration/tools/tools_e2e_tests.rs
@@ -491,7 +491,7 @@ impl ChatModel<()> for ScriptedModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let flattened = flatten_messages(&request.messages);
self.seen.lock().push(flattened.clone());
for (needle, answer) in &self.responses {
@@ -499,7 +499,7 @@ impl ChatModel<()> for ScriptedModel {
return Ok(ModelResponse::assistant(*answer));
}
}
- Err(tinyagents::TinyAgentsError::Model(format!(
+ Err(tinyagents_harness::TinyAgentsError::Model(format!(
"unexpected model request: {flattened}"
)))
}
diff --git a/src/openhuman/agent/orchestration/workflow_runs/engine_tests.rs b/src/openhuman/agent/orchestration/workflow_runs/engine_tests.rs
index 8752dc65cd..b4a6d5d2fb 100644
--- a/src/openhuman/agent/orchestration/workflow_runs/engine_tests.rs
+++ b/src/openhuman/agent/orchestration/workflow_runs/engine_tests.rs
@@ -136,7 +136,7 @@ impl ChatModel<()> for PeakModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.calls.fetch_add(1, Ordering::SeqCst);
let current = self.active.fetch_add(1, Ordering::SeqCst) + 1;
self.record_peak(current);
@@ -152,7 +152,7 @@ impl ChatModel<()> for PeakModel {
if let Some(needle) = self.fail_on.lock().as_ref() {
if flattened.contains(needle.as_str()) {
- return Err(tinyagents::TinyAgentsError::Model(
+ return Err(tinyagents_harness::TinyAgentsError::Model(
"mock model forced failure".to_string(),
));
}
diff --git a/src/openhuman/agent/orchestration/workflow_runs/graph.rs b/src/openhuman/agent/orchestration/workflow_runs/graph.rs
index 4c5f88c1e9..05173f03ca 100644
--- a/src/openhuman/agent/orchestration/workflow_runs/graph.rs
+++ b/src/openhuman/agent/orchestration/workflow_runs/graph.rs
@@ -35,8 +35,8 @@ use super::types::{WorkflowDefinition, WorkflowPhase};
/// so a ledger-write/spawn failure fails the run (and propagates back out via
/// [`drive_phases`]). A *phase* that merely failed is not an error here — it is a
/// normal `Terminated` outcome that persists `Failed` and routes to `done`.
-fn graph_err(e: anyhow::Error) -> tinyagents::TinyAgentsError {
- tinyagents::TinyAgentsError::Graph(e.to_string())
+fn graph_err(e: anyhow::Error) -> tinyagents_harness::TinyAgentsError {
+ tinyagents_harness::TinyAgentsError::Graph(e.to_string())
}
/// Typed state threaded through the scheduler graph: the phase `dispatch`
@@ -108,7 +108,7 @@ where
let run = run.clone();
async move {
let phase = s.phase.clone().ok_or_else(|| {
- tinyagents::TinyAgentsError::Graph(
+ tinyagents_harness::TinyAgentsError::Graph(
"workflow run_phase reached with no selected phase".to_string(),
)
})?;
diff --git a/src/openhuman/agent/orchestration/worktree.rs b/src/openhuman/agent/orchestration/worktree.rs
index cb16734f13..cdda153120 100644
--- a/src/openhuman/agent/orchestration/worktree.rs
+++ b/src/openhuman/agent/orchestration/worktree.rs
@@ -115,7 +115,7 @@ impl WorkspaceIsolation for OpenHumanWorktreeIsolation {
&self,
run_id: &str,
agent: Option<&str>,
- ) -> tinyagents::Result<WorkspaceDescriptor> {
+ ) -> tinyagents_harness::Result<WorkspaceDescriptor> {
tracing::debug!(
run_id,
agent = agent.unwrap_or(""),
@@ -147,7 +147,7 @@ impl WorkspaceIsolation for OpenHumanWorktreeIsolation {
Ok(descriptor)
}
- async fn cleanup(&self, descriptor: &WorkspaceDescriptor) -> tinyagents::Result<()> {
+ async fn cleanup(&self, descriptor: &WorkspaceDescriptor) -> tinyagents_harness::Result<()> {
tracing::debug!(
root = %descriptor.root.display(),
policy_id = %descriptor.policy_id,
diff --git a/src/openhuman/agent/registry/agents/researcher/graph.rs b/src/openhuman/agent/registry/agents/researcher/graph.rs
index 25f0efe55e..2988f6f1c1 100644
--- a/src/openhuman/agent/registry/agents/researcher/graph.rs
+++ b/src/openhuman/agent/registry/agents/researcher/graph.rs
@@ -44,7 +44,7 @@ enum ResearcherGraphUpdate {
}
type ResearcherGraphNodeFuture =
- Pin<Box<dyn Future<Output = tinyagents::Result<NodeResult<ResearcherGraphUpdate>>> + Send>>;
+ Pin<Box<dyn Future<Output = tinyagents_harness::Result<NodeResult<ResearcherGraphUpdate>>> + Send>>;
fn phase_node(
phase: &'static str,
@@ -82,7 +82,7 @@ fn build_researcher_graph(
.lock()
.await
.take()
- .ok_or_else(|| tinyagents::TinyAgentsError::Graph(
+ .ok_or_else(|| tinyagents_harness::TinyAgentsError::Graph(
"researcher graph missing turn request".to_string(),
))?;
tracing::debug!(
diff --git a/src/openhuman/agent/tinyagents/host/model_resolver.rs b/src/openhuman/agent/tinyagents/host/model_resolver.rs
index 2f2a2ed4f7..40dfbf3712 100644
--- a/src/openhuman/agent/tinyagents/host/model_resolver.rs
+++ b/src/openhuman/agent/tinyagents/host/model_resolver.rs
@@ -72,7 +72,7 @@ use tinyagents_harness::host::{ModelResolveRequest, ModelResolver};
use tinyagents_harness::model::{
ChatModel, ModelProfile, ModelRequest, ModelResponse, ModelStream,
};
-use tinyagents::Result as TaResult;
+use tinyagents_harness::Result as TaResult;
use crate::openhuman::config::Config;
use crate::openhuman::inference::provider::{create_chat_model_with_model_id, role_for_model_tier};
diff --git a/src/openhuman/agent/tinyagents/middleware_part_02.rs b/src/openhuman/agent/tinyagents/middleware_part_02.rs
index bd6f9a8265..819078993a 100644
--- a/src/openhuman/agent/tinyagents/middleware_part_02.rs
+++ b/src/openhuman/agent/tinyagents/middleware_part_02.rs
@@ -197,7 +197,7 @@ impl Middleware<()> for ToolOutputMiddleware {
"preview_bytes".to_string(),
serde_json::Value::from(outcome.final_bytes as u64),
);
- let index_result: tinyagents::Result<()> =
+ let index_result: tinyagents_harness::Result<()> =
store.put("tool_results", &key, fields.into()).await;
if let Err(err) = index_result {
tracing::warn!(
diff --git a/src/openhuman/agent/tinyagents/middleware_part_04.rs b/src/openhuman/agent/tinyagents/middleware_part_04.rs
index 1dfd95707a..1046388270 100644
--- a/src/openhuman/agent/tinyagents/middleware_part_04.rs
+++ b/src/openhuman/agent/tinyagents/middleware_part_04.rs
@@ -100,7 +100,7 @@ impl Middleware<()> for CostBudgetMiddleware {
%current_usd, %limit_usd, ?period,
"[tinyagents::mw] cost budget exceeded — failing before model call"
);
- Err(tinyagents::TinyAgentsError::LimitExceeded(format!(
+ Err(tinyagents_harness::TinyAgentsError::LimitExceeded(format!(
"cost budget exceeded: {period:?} spend ${current_usd:.4} \u{2265} limit ${limit_usd:.4}"
)))
}
diff --git a/src/openhuman/agent/tinyagents/mod_part_02.rs b/src/openhuman/agent/tinyagents/mod_part_02.rs
index f3dfe4fa72..2c2a7ca005 100644
--- a/src/openhuman/agent/tinyagents/mod_part_02.rs
+++ b/src/openhuman/agent/tinyagents/mod_part_02.rs
@@ -158,7 +158,7 @@ pub(crate) async fn run_turn_via_tinyagents_shared(
// Build the run context: an optional event sink feeds the progress/cost
// bridge (streaming) and/or the model-call-cap pauser; the shared steering
// handle carries mid-flight, early-exit, and cap pauses.
- let cancellation = tinyagents::CancellationToken::new();
+ let cancellation = tinyagents_harness::CancellationToken::new();
let mut ctx = RunContext::new(config, ()).with_cancellation(cancellation.clone());
if let Some(descriptor) = workspace_descriptor {
tracing::debug!(
@@ -394,13 +394,13 @@ pub(crate) async fn run_turn_via_tinyagents_shared(
break;
}
AgentStreamItem::Failed(error) => {
- terminal = Some(Err(tinyagents::TinyAgentsError::Model(error)));
+ terminal = Some(Err(tinyagents_harness::TinyAgentsError::Model(error)));
break;
}
}
}
terminal.unwrap_or_else(|| {
- Err(tinyagents::TinyAgentsError::Model(
+ Err(tinyagents_harness::TinyAgentsError::Model(
"tinyagents stream ended without terminal run".to_string(),
))
})
@@ -440,7 +440,7 @@ pub(crate) async fn run_turn_via_tinyagents_shared(
// callers downcast it (Sentry skip) and render the canonical
// "Agent exceeded maximum tool iterations" message, matching the
// legacy `ErrorCheckpoint`.
- if let tinyagents::TinyAgentsError::LimitExceeded(msg) = &e {
+ if let tinyagents_harness::TinyAgentsError::LimitExceeded(msg) = &e {
if msg.contains("model call") {
tracing::debug!(
model,
diff --git a/src/openhuman/agent/tinyagents/mod_part_03.rs b/src/openhuman/agent/tinyagents/mod_part_03.rs
index 39913f9424..f7c064162a 100644
--- a/src/openhuman/agent/tinyagents/mod_part_03.rs
+++ b/src/openhuman/agent/tinyagents/mod_part_03.rs
@@ -1,10 +1,10 @@
fn tinyagents_depth_error(
- err: &tinyagents::TinyAgentsError,
+ err: &tinyagents_harness::TinyAgentsError,
) -> Option<crate::openhuman::agent::harness::subagent_runner::SubagentRunError> {
match err {
- tinyagents::TinyAgentsError::SubAgentDepth(max_depth)
- | tinyagents::TinyAgentsError::RecursionLimit(max_depth) => {
+ tinyagents_harness::TinyAgentsError::SubAgentDepth(max_depth)
+ | tinyagents_harness::TinyAgentsError::RecursionLimit(max_depth) => {
Some(
crate::openhuman::agent::harness::subagent_runner::SubagentRunError::SpawnDepthExceeded {
attempted_depth: max_depth.saturating_add(1),
diff --git a/src/openhuman/agent/tinyagents/model.rs b/src/openhuman/agent/tinyagents/model.rs
index 57eb036c31..7436472758 100644
--- a/src/openhuman/agent/tinyagents/model.rs
+++ b/src/openhuman/agent/tinyagents/model.rs
@@ -440,12 +440,12 @@ impl ChatModel<()> for RouteRecordingModel {
self.inner.profile()
}
- async fn invoke(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelResponse> {
+ async fn invoke(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelResponse> {
self.record_route();
self.inner.invoke(state, request).await
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
self.record_route();
self.inner.stream(state, request).await
}
@@ -488,13 +488,13 @@ impl ChatModel<()> for ProfileOverrideModel {
Some(&self.profile)
}
- async fn invoke(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelResponse> {
+ async fn invoke(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelResponse> {
self.inner
.invoke(state, self.pin_request_options(request))
.await
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
self.inner
.stream(state, self.pin_request_options(request))
.await
@@ -522,11 +522,11 @@ impl ChatModel<()> for MaxTokensModel {
self.inner.profile()
}
- async fn invoke(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelResponse> {
+ async fn invoke(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelResponse> {
self.inner.invoke(state, self.cap(request)).await
}
- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
self.inner.stream(state, self.cap(request)).await
}
}
diff --git a/src/openhuman/agent/tinyagents/model_route_recording_tests_tests.rs b/src/openhuman/agent/tinyagents/model_route_recording_tests_tests.rs
index 66c832d97e..043665aebd 100644
--- a/src/openhuman/agent/tinyagents/model_route_recording_tests_tests.rs
+++ b/src/openhuman/agent/tinyagents/model_route_recording_tests_tests.rs
@@ -11,7 +11,7 @@ impl ChatModel<()> for SuccessfulModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant("ok"))
}
}
diff --git a/src/openhuman/agent/tinyagents/routes.rs b/src/openhuman/agent/tinyagents/routes.rs
index 62adbac504..e3c4f58c2b 100644
--- a/src/openhuman/agent/tinyagents/routes.rs
+++ b/src/openhuman/agent/tinyagents/routes.rs
@@ -133,7 +133,7 @@ impl ModelMiddleware<()> for RequiredCapabilitiesMiddleware {
state: &(),
mut request: ModelRequest,
next: ModelHandler<'_, (), ()>,
- ) -> tinyagents::Result<MiddlewareModelOutcome> {
+ ) -> tinyagents_harness::Result<MiddlewareModelOutcome> {
if request.required_capabilities.is_none() {
request = request.with_required_capabilities(self.required.clone());
}
@@ -204,7 +204,7 @@ impl ModelMiddleware<()> for FallbackObserverMiddleware {
state: &(),
request: ModelRequest,
next: ModelHandler<'_, (), ()>,
- ) -> tinyagents::Result<MiddlewareModelOutcome> {
+ ) -> tinyagents_harness::Result<MiddlewareModelOutcome> {
let outcome = next.run(ctx, state, request).await?;
let response = outcome.into_response();
if let Some(resolved) = response.resolved_model.as_ref() {
@@ -261,7 +261,7 @@ impl ModelMiddleware<()> for UsageCarryMiddleware {
state: &(),
request: ModelRequest,
next: ModelHandler<'_, (), ()>,
- ) -> tinyagents::Result<MiddlewareModelOutcome> {
+ ) -> tinyagents_harness::Result<MiddlewareModelOutcome> {
let outcome = next.run(ctx, state, request).await?;
let response = outcome.into_response();
if let Some(usage) = super::model::usage_info_from_response(&response) {
diff --git a/src/openhuman/agent/tinyagents/run_cancellation_context.rs b/src/openhuman/agent/tinyagents/run_cancellation_context.rs
index 94920cf8b6..60378fca8c 100644
--- a/src/openhuman/agent/tinyagents/run_cancellation_context.rs
+++ b/src/openhuman/agent/tinyagents/run_cancellation_context.rs
@@ -5,7 +5,7 @@
//! metadata. OpenHuman tools that need to fan out nested graph work can read this
//! scoped token and pass the same live cancellation signal into graph helpers.
-use tinyagents::CancellationToken;
+use tinyagents_harness::CancellationToken;
tokio::task_local! {
static CURRENT_RUN_CANCELLATION: CancellationToken;
diff --git a/src/openhuman/agent/tinyagents/stop_hooks.rs b/src/openhuman/agent/tinyagents/stop_hooks.rs
index e4f08d997d..027438f892 100644
--- a/src/openhuman/agent/tinyagents/stop_hooks.rs
+++ b/src/openhuman/agent/tinyagents/stop_hooks.rs
@@ -88,7 +88,7 @@ where
_ctx: &mut RunContext<Ctx>,
_state: &State,
response: &mut ModelResponse,
- ) -> tinyagents::Result<()> {
+ ) -> tinyagents_harness::Result<()> {
// Already paused: nothing more to do (Pause is latched once).
if self.stopped.load(Ordering::SeqCst) {
return Ok(());
diff --git a/src/openhuman/agent/tinyagents/tools.rs b/src/openhuman/agent/tinyagents/tools.rs
index 69fb652f37..deb4ceff00 100644
--- a/src/openhuman/agent/tinyagents/tools.rs
+++ b/src/openhuman/agent/tinyagents/tools.rs
@@ -108,7 +108,7 @@ impl Tool<()> for ToolAdapter {
tool_policy_from_openhuman_tool(self.inner.as_ref())
}
- async fn call(&self, _state: &(), call: TaToolCall) -> tinyagents::Result<TaToolResult> {
+ async fn call(&self, _state: &(), call: TaToolCall) -> tinyagents_harness::Result<TaToolResult> {
Ok(execute_openhuman_tool(self.inner.as_ref(), call, None).await)
}
@@ -117,7 +117,7 @@ impl Tool<()> for ToolAdapter {
_state: &(),
call: TaToolCall,
context: ToolExecutionContext,
- ) -> tinyagents::Result<TaToolResult> {
+ ) -> tinyagents_harness::Result<TaToolResult> {
Ok(execute_openhuman_tool(self.inner.as_ref(), call, Some(&context)).await)
}
}
@@ -376,7 +376,7 @@ impl Tool<()> for SharedToolAdapter {
self.policy.clone()
}
- async fn call(&self, _state: &(), call: TaToolCall) -> tinyagents::Result<TaToolResult> {
+ async fn call(&self, _state: &(), call: TaToolCall) -> tinyagents_harness::Result<TaToolResult> {
self.call_openhuman_tool(call, None).await
}
@@ -385,7 +385,7 @@ impl Tool<()> for SharedToolAdapter {
_state: &(),
call: TaToolCall,
context: ToolExecutionContext,
- ) -> tinyagents::Result<TaToolResult> {
+ ) -> tinyagents_harness::Result<TaToolResult> {
self.call_openhuman_tool(call, Some(&context)).await
}
}
@@ -395,7 +395,7 @@ impl SharedToolAdapter {
&self,
call: TaToolCall,
context: Option<&dyn ToolRunContext>,
- ) -> tinyagents::Result<TaToolResult> {
+ ) -> tinyagents_harness::Result<TaToolResult> {
let found = self
.sets
.iter()
diff --git a/src/openhuman/channels/runtime/test_support.rs b/src/openhuman/channels/runtime/test_support.rs
index ab8d41e2d0..798dea087f 100644
--- a/src/openhuman/channels/runtime/test_support.rs
+++ b/src/openhuman/channels/runtime/test_support.rs
@@ -188,7 +188,7 @@ impl ChatModel<()> for HarnessModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let message = request
.messages
.last()
diff --git a/src/openhuman/channels/tests/common.rs b/src/openhuman/channels/tests/common.rs
index 9c6c7722b4..e704aef4de 100644
--- a/src/openhuman/channels/tests/common.rs
+++ b/src/openhuman/channels/tests/common.rs
@@ -93,7 +93,7 @@ impl ChatModel<()> for DummyModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant("ok"))
}
}
@@ -182,7 +182,7 @@ impl ChatModel<()> for SlowModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
tokio::time::sleep(self.delay).await;
let message = request
.messages
@@ -207,7 +207,7 @@ impl ChatModel<()> for ToolCallingModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let has_tool_results = request.messages.iter().any(|message| {
matches!(message, Message::Tool(_)) || message.text().contains("[Tool results]")
});
@@ -246,7 +246,7 @@ impl ChatModel<()> for IterativeToolModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let completed_iterations = Self::completed_tool_iterations(&request.messages);
if completed_iterations >= self.required_tool_iterations {
Ok(ModelResponse::assistant(format!(
@@ -273,7 +273,7 @@ impl ChatModel<()> for HistoryCaptureModel {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let snapshot = request
.messages
.iter()
@@ -312,7 +312,7 @@ impl ChatModel<()> for ModelCaptureModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.call_count.fetch_add(1, Ordering::SeqCst);
self.models
.lock()
diff --git a/src/openhuman/channels/tests/discord_integration.rs b/src/openhuman/channels/tests/discord_integration.rs
index d4feebcc90..90cb11b71b 100644
--- a/src/openhuman/channels/tests/discord_integration.rs
+++ b/src/openhuman/channels/tests/discord_integration.rs
@@ -93,7 +93,7 @@ impl ChatModel<()> for FixedResponseModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant(self.response))
}
}
diff --git a/src/openhuman/channels/tests/telegram_integration.rs b/src/openhuman/channels/tests/telegram_integration.rs
index cfec6ae3f8..5476cc1b05 100644
--- a/src/openhuman/channels/tests/telegram_integration.rs
+++ b/src/openhuman/channels/tests/telegram_integration.rs
@@ -69,7 +69,7 @@ impl ChatModel<()> for FixedResponseModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
Ok(ModelResponse::assistant(self.response))
}
}
diff --git a/src/openhuman/flows/tinyflows/checkpoint_compat_tests_tests.rs b/src/openhuman/flows/tinyflows/checkpoint_compat_tests_tests.rs
index 732e7b6a2e..1fa4fcb300 100644
--- a/src/openhuman/flows/tinyflows/checkpoint_compat_tests_tests.rs
+++ b/src/openhuman/flows/tinyflows/checkpoint_compat_tests_tests.rs
@@ -34,7 +34,7 @@ async fn reads_a_database_written_by_the_previous_backend() {
// Fully qualified: the two `Checkpointer` traits share a method set, so
// importing both here would make every call in this file ambiguous.
- use tinyagents::Checkpointer as LegacyCheckpointer;
+ use tinyagents_graph::Checkpointer as LegacyCheckpointer;
let old = tinyagents_graph::SqliteCheckpointer::<serde_json::Value>::open(&db).unwrap();
let written = tinyagents_graph::Checkpoint {
diff --git a/src/openhuman/inference/README.md b/src/openhuman/inference/README.md
index baad40beed..831ccc3e49 100644
--- a/src/openhuman/inference/README.md
+++ b/src/openhuman/inference/README.md
@@ -4,7 +4,7 @@ Unified inference domain: the canonical home for everything LLM/STT/TTS/embeddin
## Responsibilities
-- Resolve workload names (`chat`, `reasoning`, `agentic`, `coding`, `memory`, `embeddings`, `heartbeat`, `learning`, `subconscious`, etc.) and provider strings (`openhuman`, `cloud`, `ollama:<model>`, `lmstudio:<model>`, `claude_agent_sdk:<model>`, `<slug>:<model>[@<temp>]`) to a concrete `Arc<dyn tinyagents::ChatModel<()>>` + model id.
+- Resolve workload names (`chat`, `reasoning`, `agentic`, `coding`, `memory`, `embeddings`, `heartbeat`, `learning`, `subconscious`, etc.) and provider strings (`openhuman`, `cloud`, `ollama:<model>`, `lmstudio:<model>`, `claude_agent_sdk:<model>`, `<slug>:<model>[@<temp>]`) to a concrete `Arc<dyn tinyinference::ChatModel<()>>` + model id.
- Manage the local AI runtime: detect/spawn/adopt `ollama serve` and LM Studio, install/run Whisper (STT) and Piper (TTS), track download progress, and enforce a minimum-context-window floor.
- Provide chat, vision (multimodal), summarization, embeddings, sentiment, and "should react" inference operations.
- Preserve config-rejection, billing, authentication, and retry classification while TinyAgents owns model-call retry execution.
diff --git a/src/openhuman/inference/embeddings/cloud_adapter.rs b/src/openhuman/inference/embeddings/cloud_adapter.rs
index 462b82b3e1..b1e8b0f7ed 100644
--- a/src/openhuman/inference/embeddings/cloud_adapter.rs
+++ b/src/openhuman/inference/embeddings/cloud_adapter.rs
@@ -32,10 +32,10 @@ impl OpenHumanCloudEmbedding {
let bearer: BearerResolver = Arc::new(move || {
let auth = AuthService::new(&state_dir, secrets_encrypt);
auth.get_provider_bearer_token(APP_SESSION_PROVIDER, None)
- .map_err(|error| tinyagents::TinyAgentsError::Embedding(error.to_string()))?
+ .map_err(|error| tinyagents_harness::TinyAgentsError::Embedding(error.to_string()))?
.filter(|token| !token.trim().is_empty())
.ok_or_else(|| {
- tinyagents::TinyAgentsError::Validation(
+ tinyagents_harness::TinyAgentsError::Validation(
"No backend session for cloud embeddings: log in to OpenHuman".into(),
)
})
diff --git a/src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs b/src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs
index bfae1b4d17..51bf161bbe 100644
--- a/src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs
+++ b/src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs
@@ -259,7 +259,7 @@ impl ChatModel<()> for ClaudeAgentSdkProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let messages = coalesce_prompt_tool_results(&request.messages);
let messages = with_prompt_tool_instructions(&messages, &request.tools);
let system = messages.iter().find_map(|message| match message {
diff --git a/src/openhuman/inference/provider/claude_code/mod.rs b/src/openhuman/inference/provider/claude_code/mod.rs
index 35f41e9f78..9da5c7fed7 100644
--- a/src/openhuman/inference/provider/claude_code/mod.rs
+++ b/src/openhuman/inference/provider/claude_code/mod.rs
@@ -219,7 +219,7 @@ impl ChatModel<()> for ClaudeCodeProvider {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let messages = crate::openhuman::agent::tinyagents::model::native_chat_messages(&request);
let response = self
.run_chat(
@@ -236,7 +236,7 @@ impl ChatModel<()> for ClaudeCodeProvider {
Ok(crate::openhuman::agent::tinyagents::model::native_model_response(&response))
}
- async fn stream(&self, _state: &(), request: ModelRequest) -> tinyagents::Result<ModelStream> {
+ async fn stream(&self, _state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {
let provider = self.clone();
let label = self.model.clone();
let (item_tx, item_rx) = tokio::sync::mpsc::unbounded_channel::<ModelStreamItem>();
diff --git a/src/openhuman/inference/provider/factory_part_02.rs b/src/openhuman/inference/provider/factory_part_02.rs
index 84137333b1..8e6c97ebaf 100644
--- a/src/openhuman/inference/provider/factory_part_02.rs
+++ b/src/openhuman/inference/provider/factory_part_02.rs
@@ -221,7 +221,7 @@ impl ChatModel<()> for DefaultTemperatureChatModel {
&self,
state: &(),
mut request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
if request.temperature.is_none() {
request.temperature = Some(self.temperature);
}
@@ -232,7 +232,7 @@ impl ChatModel<()> for DefaultTemperatureChatModel {
&self,
state: &(),
mut request: ModelRequest,
- ) -> tinyagents::Result<ModelStream> {
+ ) -> tinyagents_harness::Result<ModelStream> {
if request.temperature.is_none() {
request.temperature = Some(self.temperature);
}
diff --git a/src/openhuman/inference/provider/factory_tests_part_02_tests.rs b/src/openhuman/inference/provider/factory_tests_part_02_tests.rs
index 26b4ca34d7..fd8ea19c92 100644
--- a/src/openhuman/inference/provider/factory_tests_part_02_tests.rs
+++ b/src/openhuman/inference/provider/factory_tests_part_02_tests.rs
@@ -112,7 +112,7 @@ async fn one_shot_chat_models_preserve_factory_temperature_as_request_default()
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.seen
.lock()
.expect("probe lock")
diff --git a/src/openhuman/skills/e2e_plumbing_tests.rs b/src/openhuman/skills/e2e_plumbing_tests.rs
index 922718e43b..1de295bc7e 100644
--- a/src/openhuman/skills/e2e_plumbing_tests.rs
+++ b/src/openhuman/skills/e2e_plumbing_tests.rs
@@ -49,7 +49,7 @@ use tinyagents_harness::tool::ToolCall;
// `agent/harness/subagent_runner/ops_tests.rs`; kept local so this file is
// self-contained).
struct ScriptedModel {
- responses: Mutex<Vec<tinyagents::Result<ModelResponse>>>,
+ responses: Mutex<Vec<tinyagents_harness::Result<ModelResponse>>>,
}
#[async_trait]
@@ -58,7 +58,7 @@ impl ChatModel<()> for ScriptedModel {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
self.responses.lock().remove(0)
}
}
diff --git a/src/openhuman/skills/e2e_run_tests.rs b/src/openhuman/skills/e2e_run_tests.rs
index b7f43fbb68..2a854113a6 100644
--- a/src/openhuman/skills/e2e_run_tests.rs
+++ b/src/openhuman/skills/e2e_run_tests.rs
@@ -118,7 +118,7 @@ impl ChatModel<()> for MockLlm {
&self,
_state: &(),
request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
+ ) -> tinyagents_harness::Result<ModelResponse> {
let convo: String = request
.messages
.iter()
@@ -451,8 +451,8 @@ impl ChatModel<()> for FailingLlm {
&self,
_state: &(),
_request: ModelRequest,
- ) -> tinyagents::Result<ModelResponse> {
- Err(tinyagents::TinyAgentsError::Model(
+ ) -> tinyagents_harness::Result<ModelResponse> {
+ Err(tinyagents_harness::TinyAgentsError::Model(
"simulated provider failure: model unavailable".to_string(),
))
}