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;