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
fix(prompts): use tinyagents json tool renderer
Steven Enamakel2e540a0a2d34
diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rsindex 44769ca5f3..13e0269dd6 100644--- a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs@@ -12,9 +12,7 @@ use super::workspace_files::{};use std::fmt::Write;use std::path::Path;-use tinytools_agent::dialect::{- CodeDialect, NativeDialect, PFormatDialect, ToolDialect, XmlDialect,-};+use tinytools_agent::dialect::{CodeDialect, NativeDialect, PFormatDialect, ToolDialect};// ─────────────────────────────────────────────────────────────────────────────// Sub-agent prompt renderer@@ -246,7 +244,7 @@ pub fn render_subagent_system_prompt_with_format(fn render_tool_dialect_prompt(format: ToolCallFormat, tools: &[tinytools::ToolSpec]) -> String {match format {ToolCallFormat::Native => NativeDialect.prompt_instructions(tools),- ToolCallFormat::Json => XmlDialect.prompt_instructions(tools),+ ToolCallFormat::Json => harness_json_tool_prompt(tools),ToolCallFormat::PFormat => {let registry = tinytools_agent::build_registry(tools@@ -269,3 +267,19 @@ fn render_tool_dialect_prompt(format: ToolCallFormat, tools: &[tinytools::ToolSp}}}++/// Use TinyAgents' complete text-mode prompt contract rather than teaching a+/// local JSON convention that could drift from transcript replay and parsing.+fn harness_json_tool_prompt(tools: &[tinytools::ToolSpec]) -> String {+ let schemas: Vec<tinyinference_llm::tool::ToolSchema> = tools+ .iter()+ .map(|tool| {+ tinyinference_llm::tool::ToolSchema::new(+ tool.name.clone(),+ tool.description.clone(),+ tool.parameters.clone(),+ )+ })+ .collect();+ tinyagents_harness::tool::prompt_tool_instructions(&schemas)+}diff --git a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rsindex c7abaef2bd..b271823739 100644--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs@@ -184,10 +184,10 @@ pub(crate) fn subagent_prompt_protocol() -> (crate::agent::prompts::ToolCallFormat, String) {use crate::agent::prompts::ToolCallFormat;use tinytools_agent::dialect::{- CodeDialect, CodeStyle, NativeDialect, PFormatDialect, ToolDialect, XmlDialect,+ CodeDialect, CodeStyle, NativeDialect, PFormatDialect, ToolDialect,};if text_mode {- return (ToolCallFormat::Json, XmlDialect.prompt_instructions(tools));+ return (ToolCallFormat::Json, harness_json_tool_prompt(tools));}let instructions = match parent_format {ToolCallFormat::PFormat => {@@ -199,13 +199,29 @@ pub(crate) fn subagent_prompt_protocol(PFormatDialect::new(registry).prompt_instructions(tools)}ToolCallFormat::Native => NativeDialect.prompt_instructions(tools),- ToolCallFormat::Json => XmlDialect.prompt_instructions(tools),+ ToolCallFormat::Json => harness_json_tool_prompt(tools),ToolCallFormat::Python => CodeDialect::instructions(CodeStyle::Python),ToolCallFormat::TypeScript => CodeDialect::instructions(CodeStyle::TypeScript),};(parent_format, instructions)}+/// TinyAgents owns the JSON text-mode contract, including the result replay+/// instructions paired with its `<tool_call>` parser.+fn harness_json_tool_prompt(tools: &[tinytools::ToolSpec]) -> String {+ let schemas: Vec<tinyinference_llm::tool::ToolSchema> = tools+ .iter()+ .map(|tool| {+ tinyinference_llm::tool::ToolSchema::new(+ tool.name.clone(),+ tool.description.clone(),+ tool.parameters.clone(),+ )+ })+ .collect();+ tinyagents_harness::tool::prompt_tool_instructions(&schemas)+}+// ── Tool filtering ──────────────────────────────────────────────────────/// Tools that spawn a new sub-agent turn. A sub-agent must never bediff --git a/crates/openhuman-core/src/agent/subagent_host/tool_prep_tests.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep_tests.rsindex 6f908052ad..13bff36209 100644--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep_tests.rs+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep_tests.rs@@ -471,7 +471,7 @@ fn text_mode_child_of_a_native_parent_renders_its_tool_catalogue() {);let rendered = render_tools_at(format, &instructions);assert!(- rendered.contains("- **composio_execute**:"),+ rendered.contains("**composio_execute**:"),"text-mode child has no tool catalogue: {rendered:?}");