Skip to content

fix(skills): instruct agent to use exact absolute path for skill files#1104

Open
buidackim wants to merge 1 commit intonextlevelbuilder:devfrom
buidackim:fix/skill-path-prompt
Open

fix(skills): instruct agent to use exact absolute path for skill files#1104
buidackim wants to merge 1 commit intonextlevelbuilder:devfrom
buidackim:fix/skill-path-prompt

Conversation

@buidackim
Copy link
Copy Markdown

Problem

The system prompt contains conflicting guidance that causes weaker models to mangle skill file paths:

  1. Skills section says: read its SKILL.md at the location path with read_file
  2. Workspace section says: Use relative paths — do not guess absolute paths

Models like MiniMax-M2.7 try to reconcile both instructions by stripping the absolute prefix from the skill path (e.g. /app/data/skills-store/gpt-image-2-pro-max/1/SKILL.mdskills/gpt-image-2-pro-max-main/SKILL.md), causing file not found errors.

Fix

Resolves the contradiction by clarifying the boundary:

  • Workspace section: relative paths for user files, exact absolute paths for skills
  • Skills section (inline + search modes): adds (use the EXACT absolute path provided)
  • skill_search result: adds the same emphasis in the ACTION REQUIRED instruction

Files Changed

  • internal/agent/systemprompt.go — 3 string changes in prompt guidance
  • internal/tools/skill_search.go — 1 string change in search result instruction

Impact

Minimal prompt size increase (~30 tokens). Helps weaker models follow skill paths correctly without affecting stronger models.

The system prompt had conflicting guidance: the Skills section told
the agent to read SKILL.md at the provided location path, while the
Workspace section said 'do not guess absolute paths'. Weaker models
(e.g. MiniMax-M2.7) would try to reconcile both instructions by
stripping the absolute prefix and converting to a relative path,
causing 'file not found' errors.

This change:
- Adds '(use the EXACT absolute path provided)' to skill reading
  instructions in both inline and search modes
- Clarifies workspace guidance: relative paths for user files,
  exact absolute paths for skills
- Updates skill_search result instruction with the same emphasis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant