refactor: clarify tool call XML placement and add strict rules against result fabrication and internal narration

This commit is contained in:
CJACK
2026-04-05 17:13:59 +08:00
parent 088a750338
commit 22efd8178b
3 changed files with 41 additions and 4 deletions

View File

@@ -86,6 +86,12 @@ func TestBuildOpenAIFinalPrompt_VercelPreparePathKeepsFinalAnswerInstruction(t *
if !strings.Contains(finalPrompt, "Do NOT wrap the XML in markdown code fences") {
t.Fatalf("vercel prepare finalPrompt missing no-fence xml instruction: %q", finalPrompt)
}
if !strings.Contains(finalPrompt, "If a tool call fails, is rejected, or returns no usable result") {
t.Fatalf("vercel prepare finalPrompt missing failure recovery instruction: %q", finalPrompt)
}
if !strings.Contains(finalPrompt, "Never claim that a tool was run") {
t.Fatalf("vercel prepare finalPrompt missing no-fabrication instruction: %q", finalPrompt)
}
if strings.Contains(finalPrompt, "```json") {
t.Fatalf("vercel prepare finalPrompt should not require fenced tool calls: %q", finalPrompt)
}