fix(hephaestus): add tool call format instructions to prevent malformed output

GPT-5.x Codex models occasionally hallucinate malformed tool calls like:
  assistant to=functions.XXX <garbled_unicode>json\n{...}

This is a model-level issue where the model outputs tool calls as text
instead of using the native tool calling mechanism. Add explicit prompt
instructions telling the model to use the tool call interface.

Related: #2190
This commit is contained in:
acamq
2026-02-27 12:58:05 -07:00
parent ca2e046eb5
commit 2f4d9316c0
2 changed files with 20 additions and 1 deletions
+3 -1
View File
@@ -16,6 +16,7 @@ import {
buildOracleSection,
buildHardBlocksSection,
buildAntiPatternsSection,
buildToolCallFormatSection,
categorizeTools,
} from "./dynamic-agent-prompt-builder";
@@ -127,7 +128,7 @@ 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}