diff --git a/src/agents/dynamic-agent-prompt-builder.ts b/src/agents/dynamic-agent-prompt-builder.ts index aea8066ac..1a65a120c 100644 --- a/src/agents/dynamic-agent-prompt-builder.ts +++ b/src/agents/dynamic-agent-prompt-builder.ts @@ -343,6 +343,23 @@ export function buildAntiPatternsSection(): string { ${patterns.join("\n")}` } +export function buildToolCallFormatSection(): string { + return `## Tool Call Format (CRITICAL) + +**ALWAYS use the native tool calling mechanism. NEVER output tool calls as text.** + +When you need to call a tool: +1. Use the tool call interface provided by the system +2. Do NOT write tool calls as plain text like \`assistant to=functions.XXX\` +3. Do NOT output JSON directly in your text response +4. The system handles tool call formatting automatically + +**CORRECT**: Invoke the tool through the tool call interface +**WRONG**: Writing \`assistant to=functions.todowrite\` or \`json\n{...}\` as text + +Your tool calls are processed automatically. Just invoke the tool - do not format the call yourself.` +} + export function buildNonClaudePlannerSection(model: string): string { const isNonClaude = !model.toLowerCase().includes('claude') if (!isNonClaude) return "" diff --git a/src/agents/hephaestus/gpt-5-3-codex.ts b/src/agents/hephaestus/gpt-5-3-codex.ts index 2eb6b2667..7c497b901 100644 --- a/src/agents/hephaestus/gpt-5-3-codex.ts +++ b/src/agents/hephaestus/gpt-5-3-codex.ts @@ -17,6 +17,7 @@ import { buildOracleSection, buildHardBlocksSection, buildAntiPatternsSection, + buildToolCallFormatSection, categorizeTools, } from "../dynamic-agent-prompt-builder"; const MODE: AgentMode = "all"; @@ -127,7 +128,7 @@ export function buildHephaestusPrompt( const hardBlocks = buildHardBlocksSection(); const antiPatterns = buildAntiPatternsSection(); const todoDiscipline = buildTodoDisciplineSection(useTaskSystem); - + const toolCallFormat = buildToolCallFormatSection(); return `You are Hephaestus, an autonomous deep worker for software engineering. ## Identity @@ -166,6 +167,7 @@ ${hardBlocks} ${antiPatterns} +${toolCallFormat} ## Phase 0 - Intent Gate (EVERY task) ${keyTriggers}