Skip to content

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

fix(prompts): omit unavailable and native tool catalogues

Steven Enamakel9091567017a6
diff --git a/crates/openhuman-core/src/agent/debug/mod.rs b/crates/openhuman-core/src/agent/debug/mod.rs
index 19ef328a26..a67bfae866 100644
--- a/crates/openhuman-core/src/agent/debug/mod.rs
+++ b/crates/openhuman-core/src/agent/debug/mod.rs
@@ -492,8 +492,9 @@ async fn render_integrations_agent(config: &Config, toolkit: &str) -> Result<Dum
)
})
.collect();
- let dispatcher_instructions =
- tinyagents_harness::tool::prompt_tool_instructions(&text_mode_schemas);
+ let dispatcher_instructions = (!text_mode_schemas.is_empty())
+ .then(|| tinyagents_harness::tool::prompt_tool_instructions(&text_mode_schemas))
+ .unwrap_or_default();
let ctx = PromptContext {
workspace_dir: agent.workspace_dir(),
model_name: &model_name,
diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
index 13e0269dd6..e4a60d279a 100644
--- a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs
@@ -243,7 +243,10 @@ pub fn render_subagent_system_prompt_with_format(
/// corresponding dialect accepts. OpenHuman deliberately owns no syntax here.
fn render_tool_dialect_prompt(format: ToolCallFormat, tools: &[tinytools::ToolSpec]) -> String {
match format {
- ToolCallFormat::Native => NativeDialect.prompt_instructions(tools),
+ // Native providers receive the catalogue in the request's structured
+ // `tools` field. Rendering it in the system prompt duplicates large
+ // integration toolkits and can exhaust the context window.
+ ToolCallFormat::Native => NativeDialect.prompt_instructions(&[]),
ToolCallFormat::Json => harness_json_tool_prompt(tools),
ToolCallFormat::PFormat => {
let registry = tinytools_agent::build_registry(
diff --git a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
index b271823739..6659122083 100644
--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
@@ -198,7 +198,9 @@ pub(crate) fn subagent_prompt_protocol(
);
PFormatDialect::new(registry).prompt_instructions(tools)
}
- ToolCallFormat::Native => NativeDialect.prompt_instructions(tools),
+ // The native request carries its own structured catalogue; retain
+ // only the dialect guidance in the text prompt.
+ ToolCallFormat::Native => NativeDialect.prompt_instructions(&[]),
ToolCallFormat::Json => harness_json_tool_prompt(tools),
ToolCallFormat::Python => CodeDialect::instructions(CodeStyle::Python),
ToolCallFormat::TypeScript => CodeDialect::instructions(CodeStyle::TypeScript),