From c4e88d63ea514c325f2e93dcb839c5bd96d1bd1f Mon Sep 17 00:00:00 2001 From: MoerAI Date: Tue, 12 May 2026 18:56:24 +0900 Subject: [PATCH] fix(agents): add run_in_background to category task() examples in prompts (fixes #3960) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The task() tool schema declares run_in_background as a REQUIRED parameter, but three prompt-template files contained category-based task() examples that omitted it. When agents copied these patterns into actual tool calls, the runtime validator threw 'run_in_background parameter is REQUIRED', breaking delegation. Add run_in_background=false to the four offending category-based examples: 2 in src/agents/dynamic-agent-category-skills-guide.ts (Delegation Pattern + Category Domain Matching CORRECT/WRONG pair), 1 in src/agents/hephaestus/gpt-5-3-codex.ts (frontend example), and 1 in src/agents/sisyphus/gemini.ts (Example 4 DELEGATE). Subagent-type explore/librarian examples already correctly use run_in_background=true. atlas/shared-prompt.ts examples were already correct. Verification: bun test src/agents/ — 373 pass, 0 fail. bun run typecheck — clean. Grep confirms no remaining category task() examples lack the parameter. --- src/agents/dynamic-agent-category-skills-guide.ts | 5 +++-- src/agents/hephaestus/gpt-5-3-codex.ts | 1 + src/agents/sisyphus/gemini.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/agents/dynamic-agent-category-skills-guide.ts b/src/agents/dynamic-agent-category-skills-guide.ts index f7e639874..23b7d5ad0 100644 --- a/src/agents/dynamic-agent-category-skills-guide.ts +++ b/src/agents/dynamic-agent-category-skills-guide.ts @@ -102,6 +102,7 @@ Check the \`skill\` tool for available skills and their descriptions. For EVERY task( category="[selected-category]", load_skills=["skill-1", "skill-2"], // Include ALL relevant skills - ESPECIALLY user-installed ones + run_in_background=false, prompt="..." ) \`\`\` @@ -123,10 +124,10 @@ Any task involving UI, UX, CSS, styling, layout, animation, design, or frontend \`\`\`typescript // CORRECT: Visual work → visual-engineering category -task(category="visual-engineering", load_skills=["frontend-ui-ux"], prompt="Redesign the sidebar layout with new spacing...") +task(category="visual-engineering", load_skills=["frontend-ui-ux"], run_in_background=false, prompt="Redesign the sidebar layout with new spacing...") // WRONG: Visual work in wrong category - WILL PRODUCE INFERIOR RESULTS -task(category="quick", load_skills=[], prompt="Redesign the sidebar layout with new spacing...") +task(category="quick", load_skills=[], run_in_background=false, prompt="Redesign the sidebar layout with new spacing...") \`\`\` | Task Domain | MUST Use Category | diff --git a/src/agents/hephaestus/gpt-5-3-codex.ts b/src/agents/hephaestus/gpt-5-3-codex.ts index 28127bcc8..fcf7de803 100644 --- a/src/agents/hephaestus/gpt-5-3-codex.ts +++ b/src/agents/hephaestus/gpt-5-3-codex.ts @@ -381,6 +381,7 @@ When delegating, ALWAYS check if relevant skills should be loaded: task( category="visual-engineering", load_skills=["frontend-ui-ux"], + run_in_background=false, prompt="1. TASK: Build the settings page... 2. EXPECTED OUTCOME: ..." ) \`\`\` diff --git a/src/agents/sisyphus/gemini.ts b/src/agents/sisyphus/gemini.ts index cba019d27..567ebc54a 100644 --- a/src/agents/sisyphus/gemini.ts +++ b/src/agents/sisyphus/gemini.ts @@ -142,7 +142,7 @@ export function buildGeminiToolCallExamples(): string { **User**: "Add a new /health endpoint to the API" **CORRECT**: \`\`\` -→ Call Task(category="quick", load_skills=["typescript-programmer"], prompt="...") +→ Call Task(category="quick", load_skills=["typescript-programmer"], run_in_background=false, prompt="...") → (After agent completes) Read changed files to verify → Call LspDiagnostics on changed files → Report