fix(agents): add run_in_background to category task() examples in prompts (fixes #3960)

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.
This commit is contained in:
MoerAI
2026-05-12 18:56:24 +09:00
parent 75825eb9a6
commit c4e88d63ea
3 changed files with 5 additions and 3 deletions
@@ -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 |
+1
View File
@@ -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: ..."
)
\`\`\`
+1 -1
View File
@@ -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