fix: add clarifying instruction to distinguish skills from tools in skill prompt (#2438) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #2442
Conversation
…kill prompt (agentscope-ai#2438) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Code Review — Approved ✅
Overall: Simple and effective fix for #2438. The prompt clarification correctly instructs the agent to distinguish between skills (from <available_skills>) and tools (from the system prompt).
Analysis:
-
Root Cause: The agent was conflating skills (specialized capabilities registered via SkillRepository) with tools (general capabilities like file management, network requests, etc.) when responding to "what skills do you have" queries.
-
Fix: Added a clear instruction in the prompt template:
- Skills are listed in
<available_skills> - Tools are described separately in the system prompt
- When asked about skills, only list from
<available_skills>, not tools
- Skills are listed in
-
Impact: Minimal risk — this is a prompt-only change with no code logic modifications. The instruction is clear and unambiguous.
CI Status: ✅ All checks passed
Verdict: Clean, minimal fix that addresses the reported issue. The prompt instruction is well-worded and should effectively prevent the confusion between skills and tools.
Description
When the agent is asked "what skills do you have" (
你有哪些技能?), the LLM response includes both skills (from<available_skills>) and tools from the Toolkit (file management, network requests, memory, etc.). This is because the system prompt lists both, and the LLM naturally includes everything it sees.Root cause: The
AgentSkillPromptProvider.DEFAULT_AGENT_SKILL_INSTRUCTIONdoes not instruct the LLM to distinguish between skills and tools. The<available_skills>section shows skills, but the LLM also sees tool definitions elsewhere in the system prompt and considers them part of its "skills."Fix: Added a clarifying instruction block after
</usage>and before<available_skills>that explicitly tells the LLM:<available_skills>lists only skills (specialized capabilities)<available_skills>Testing: This is a prompt-level change. The fix is verified by checking that the instruction text is added to the
DEFAULT_AGENT_SKILL_INSTRUCTIONconstant. No functional code changes were made.Closes #2438
[FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]