From 09d4896344f01d373cbe3c165abcb5d89e09a8ff Mon Sep 17 00:00:00 2001 From: tianguicheng Date: Wed, 29 Apr 2026 14:27:58 +0800 Subject: [PATCH] fix(agents): enforce exact skill path from The agent could fabricate or guess SKILL.md paths instead of using the exact value provided in . Add an explicit prompt-level constraint to prevent path hallucination. Refs: #50590, #43735, #43383 --- src/agents/system-prompt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 9d87d2a2b3f..ed53344f345 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -202,7 +202,7 @@ function buildSkillsSection(params: { skillsPrompt?: string; readToolName: strin return [ "## Skills (mandatory)", "Before replying: scan entries.", - `- If exactly one skill clearly applies: read its SKILL.md at with \`${params.readToolName}\`, then follow it.`, + `- If exactly one skill clearly applies: read its SKILL.md at with \`${params.readToolName}\`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.`, "- If multiple could apply: choose the most specific one, then read/follow it.", "- If none clearly apply: do not read any SKILL.md.", "Constraints: never read more than one skill up front; only read after selecting.",