The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor: migrate test model implementations from tinyagents_harness to tinyinference result types
Steven Enamakel71388ec47ff5
diff --git a/src/openhuman/agent/agent_tests.rs b/src/openhuman/agent/agent_tests.rsindex 0c796cb78f..c0f367d819 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let mut guard = self.responses.lock().unwrap();let response = if guard.is_empty() {ChatResponse {@@ -103,7 +103,7 @@ impl ChatModel<()> for FailingProvider {&self,_state: &(),_request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::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.rsindex 1173848e39..94cddc1738 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let response = self.response.lock().take().unwrap_or_else(|| {Ok(ChatResponse {text: Some("done".into()),@@ -44,7 +44,7 @@ impl ChatModel<()> for StaticModel {}}- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyinference::Result<ModelStream> {let response = self.invoke(state, request).await?;Ok(Box::pin(futures::stream::iter(vec![ModelStreamItem::Started,@@ -92,7 +92,7 @@ impl ChatModel<()> for PersistentErrModel {&self,_state: &(),_request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::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.rsindex e1d721e6c1..2e09f3af26 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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelStream> {+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelStream> {+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyinference::Result<ModelStream> {let response = self.invoke(state, request).await?;Ok(Box::pin(futures::stream::iter(vec![ModelStreamItem::Started,diff --git a/src/openhuman/agent/harness/session/turn_tests.rs b/src/openhuman/agent/harness/session/turn_tests.rsindex 93921cac91..5423de27aa 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(ModelResponse::assistant("unused"))}}@@ -67,7 +67,7 @@ impl ChatModel<()> for SequenceProvider {&self,_state: &(),request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {self.tool_counts.lock().await.push(request.tools.len());self.requests.lock().await.push(request@@ -104,7 +104,7 @@ impl ChatModel<()> for SequenceProvider {}}- async fn stream(&self, state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {+ async fn stream(&self, state: &(), request: ModelRequest) -> tinyinference::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-owneddiff --git a/src/openhuman/agent/harness/subagent_runner/ops/graph_tests.rs b/src/openhuman/agent/harness/subagent_runner/ops/graph_tests.rsindex 6ce99b8d9e..ab7d288dbd 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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(ModelResponse::assistant("Hello"))}- async fn stream(&self, _state: &(), _request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {+ async fn stream(&self, _state: &(), _request: ModelRequest) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::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.rsindex 34476402b3..f3ee9c1382 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(self.take_response(request))}- async fn stream(&self, _state: &(), request: ModelRequest) -> tinyagents_harness::Result<ModelStream> {+ async fn stream(&self, _state: &(), request: ModelRequest) -> tinyinference::Result<ModelStream> {let response = self.take_response(request);let reasoning = response.messagediff --git a/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs b/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rsindex 22d721c05b..4b517a6c95 100644--- a/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs+++ b/src/openhuman/agent/orchestration/agent_teams/runtime_tests.rs@@ -97,7 +97,7 @@ impl ChatModel<()> for CannedModel {&self,_state: &(),_request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {if self.fail {return Err(tinyagents_harness::TinyAgentsError::Model("mock model forced failure".to_string(),diff --git a/src/openhuman/agent/orchestration/ops_tests.rs b/src/openhuman/agent/orchestration/ops_tests.rsindex 60e86c257a..a949bc2e16 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let flattened = request.messages.iter()@@ -225,7 +225,7 @@ impl ChatModel<()> for ParallelCodingModel {&self,_state: &(),request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {tokio::time::sleep(Duration::from_secs(60)).await;Ok(text_response("NEVER_REACHED"))}diff --git a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents_tests.rsindex 2a881fb125..8e0f3a48ab 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_harness::Result<ModelResponse> {+ async fn respond_for_subagent(&self, flattened: &str) -> tinyinference::Result<ModelResponse> {let current = self.state.active_subagent_calls@@ -345,7 +345,7 @@ impl ParallelHarnessProvider {sleep(Duration::from_millis(5)).await;}- let response = (|| -> tinyagents_harness::Result<ModelResponse> {+ let response = (|| -> tinyinference::Result<ModelResponse> {if flattened.contains(RESEARCH_PROMPT_CANARY) {if flattened.contains("research-step-3-ok") {Ok(text_response(RESEARCH_DONE_CANARY))@@ -415,7 +415,7 @@ impl ChatModel<()> for ParallelHarnessProvider {&self,_state: &(),request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {self.state.total_calls.fetch_add(1, Ordering::SeqCst);let flattened = request.messagesdiff --git a/src/openhuman/agent/orchestration/tools/tools_e2e_tests.rs b/src/openhuman/agent/orchestration/tools/tools_e2e_tests.rsindex 00c4ffd404..1207ee6714 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let flattened = flatten_messages(&request.messages);self.seen.lock().push(flattened.clone());for (needle, answer) in &self.responses {diff --git a/src/openhuman/agent/orchestration/workflow_runs/engine_tests.rs b/src/openhuman/agent/orchestration/workflow_runs/engine_tests.rsindex 6e7f31d19f..52c8fc4515 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {self.calls.fetch_add(1, Ordering::SeqCst);let current = self.active.fetch_add(1, Ordering::SeqCst) + 1;self.record_peak(current);diff --git a/src/openhuman/agent/tinyagents/model_route_recording_tests_tests.rs b/src/openhuman/agent/tinyagents/model_route_recording_tests_tests.rsindex 043665aebd..f6e593867f 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(ModelResponse::assistant("ok"))}}diff --git a/src/openhuman/channels/runtime/test_support.rs b/src/openhuman/channels/runtime/test_support.rsindex 18af20c199..6b7800dc13 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let message = request.messages.last()diff --git a/src/openhuman/channels/tests/common.rs b/src/openhuman/channels/tests/common.rsindex 547336a0ae..776da44577 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(ModelResponse::assistant("ok"))}}@@ -182,7 +182,7 @@ impl ChatModel<()> for SlowModel {&self,_state: &(),request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let snapshot = request.messages.iter()@@ -312,7 +312,7 @@ impl ChatModel<()> for ModelCaptureModel {&self,_state: &(),_request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::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.rsindex d3c5ab6aa3..b8f81b3c7e 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(ModelResponse::assistant(self.response))}}diff --git a/src/openhuman/channels/tests/telegram_integration.rs b/src/openhuman/channels/tests/telegram_integration.rsindex dc461fb9f3..cbdca00543 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Ok(ModelResponse::assistant(self.response))}}diff --git a/src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs b/src/openhuman/inference/provider/claude_agent_sdk/subprocess.rsindex 2aded78a98..114d6847c4 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_harness::Result<ModelResponse> {+ ) -> tinyinference::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.rsindex 39e8d0f249..51d4bd5f07 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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelStream> {+ async fn stream(&self, _state: &(), request: ModelRequest) -> tinyinference::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.rsindex 4fb464949a..e3756781b1 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_harness::Result<ModelResponse> {+ ) -> tinyinference::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_harness::Result<ModelStream> {+ ) -> tinyinference::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.rsindex 8da6a389f7..a3b9e1f95a 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_harness::Result<ModelResponse> {+ ) -> tinyinference::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.rsindex 2cad16b1e8..a875231262 100644--- a/src/openhuman/skills/e2e_plumbing_tests.rs+++ b/src/openhuman/skills/e2e_plumbing_tests.rs@@ -49,7 +49,7 @@ use tinyinference::tool::ToolCall;// `agent/harness/subagent_runner/ops_tests.rs`; kept local so this file is// self-contained).struct ScriptedModel {- responses: Mutex<Vec<tinyagents_harness::Result<ModelResponse>>>,+ responses: Mutex<Vec<tinyinference::Result<ModelResponse>>>,}#[async_trait]@@ -58,7 +58,7 @@ impl ChatModel<()> for ScriptedModel {&self,_state: &(),_request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {self.responses.lock().remove(0)}}diff --git a/src/openhuman/skills/e2e_run_tests.rs b/src/openhuman/skills/e2e_run_tests.rsindex 6d471f3ec1..c58f379336 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_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {let convo: String = request.messages.iter()@@ -451,7 +451,7 @@ impl ChatModel<()> for FailingLlm {&self,_state: &(),_request: ModelRequest,- ) -> tinyagents_harness::Result<ModelResponse> {+ ) -> tinyinference::Result<ModelResponse> {Err(tinyagents_harness::TinyAgentsError::Model("simulated provider failure: model unavailable".to_string(),))