mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:30:44 +00:00
fix(agents): enforce exact skill path from <available_skills>
The agent could fabricate or guess SKILL.md paths instead of using the exact <location> value provided in <available_skills>. Add an explicit prompt-level constraint to prevent path hallucination. Refs: #50590, #43735, #43383
This commit is contained in:
@@ -202,7 +202,7 @@ function buildSkillsSection(params: { skillsPrompt?: string; readToolName: strin
|
||||
return [
|
||||
"## Skills (mandatory)",
|
||||
"Before replying: scan <available_skills> <description> entries.",
|
||||
`- If exactly one skill clearly applies: read its SKILL.md at <location> with \`${params.readToolName}\`, then follow it.`,
|
||||
`- If exactly one skill clearly applies: read its SKILL.md at <location> with \`${params.readToolName}\`, then follow it. You MUST use the exact <location> value from <available_skills>; 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.",
|
||||
|
||||
Reference in New Issue
Block a user