Skip to content

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

fix(prompts): skip duplicate tool catalogue for JSON dispatcher

Steven Enamakela966199d5a3b
diff --git a/crates/openhuman-core/src/agent/prompts/sections.rs b/crates/openhuman-core/src/agent/prompts/sections.rs
index 6afc5cf662..e1cc4f0500 100644
--- a/crates/openhuman-core/src/agent/prompts/sections.rs
+++ b/crates/openhuman-core/src/agent/prompts/sections.rs
@@ -391,9 +391,18 @@ impl PromptSection for ToolsSection {
}
})
.collect();
- let mut out = match ctx.tool_call_format.code_style() {
- Some(style) => tinytools_agent::render::render_code_catalogue(&visible, style),
- None => render_pformat_catalogue(&visible),
+ // The JSON dialect's protocol block embeds its own full-schema
+ // catalogue (`XmlDialect::embeds_tool_catalogue`), so rendering the
+ // signature catalogue as well listed every tool twice — 13 KB of
+ // P-Format signatures on top of 28 KB of schemas for the orchestrator.
+ let mut out = match ctx.tool_call_format {
+ ToolCallFormat::Json if !ctx.dispatcher_instructions.trim().is_empty() => {
+ String::new()
+ }
+ format => match format.code_style() {
+ Some(style) => tinytools_agent::render::render_code_catalogue(&visible, style),
+ None => render_pformat_catalogue(&visible),
+ },
};
if !ctx.dispatcher_instructions.is_empty() {
out.push('\n');