From 342cfb75bdc43f4a719b59e45c761cf2f6f7bffa Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 May 2026 16:07:53 +0000 Subject: [PATCH] feat: enable parallel tool call batching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix mangled system prompt rule 3 — now explicitly instructs batching - Add parallel_tool_calls: true to API body (required by many providers) - Strengthen batching language: #1 speed optimization, NEVER serialize --- src/bot/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bot/index.js b/src/bot/index.js index 80247423..8515882a 100644 --- a/src/bot/index.js +++ b/src/bot/index.js @@ -76,7 +76,10 @@ function buildSystemPrompt(svc) { ' - Fetch URLs: Use `browser` or `web_fetch` (NOT curl/wget)', ' Use bash ONLY for: tests, installs, git, systemctl, and commands no tool covers.', ' Violating this rule wastes turns and bypasses caching.', - ' tool calls in a single turn. Example: reading 3 files = 3 parallel calls in 1 turn, NOT 3 turns.', + '3. **BATCH independent calls.** ALWAYS emit multiple independent tool calls in a single turn.', + ' Reading 3 files = 3 parallel calls in 1 turn, NOT 3 sequential turns.', + ' Searching 2 patterns + reading 1 file = 3 calls in 1 turn. This is the #1 speed optimization.', + ' NEVER serialize independent operations — the runtime executes them concurrently via Promise.all.', '4. **No ghost chasing.** If a command fails (wrong path, file not found), do NOT retry the', ' same command. Use `glob` or `ls` to find the correct path, then proceed.', '5. **Plan before acting.** For tasks requiring 3+ tool calls, think through the optimal sequence', @@ -551,6 +554,7 @@ export async function initBot(config, api, tools, skills, agents) { messages: loopMessages, temperature: opts.temperature ?? 0.7, max_tokens: opts.maxTokens || 8192, + parallel_tool_calls: true, }; if (toolSchemas.length) body.tools = toolSchemas;