From defcdd38811d005115804bfe60323a96e4a6d6c4 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 26 Oct 2026 23:46:12 +0800 Subject: [PATCH 1/2] fix: prefer file-reading tools when loading skills --- astrbot/core/skills/skill_manager.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/astrbot/core/skills/skill_manager.py b/astrbot/core/skills/skill_manager.py index d996dd7a070..c71d5e0ba84 100644 --- a/astrbot/core/skills/skill_manager.py +++ b/astrbot/core/skills/skill_manager.py @@ -268,9 +268,15 @@ def build_skills_prompt(skills: list[SkillInfo]) -> str: "*Never silently skip a matching skill* — either use it or briefly " "explain why you chose not to.\n" "3. **Mandatory grounding** — Before executing any skill you MUST " - "first read its `SKILL.md` by running a shell command compatible " - "with the current runtime shell and using the **absolute path** " - f"shown above (e.g. `{example_command}`). " + "first read its `SKILL.md` in full using the **absolute path** " + "shown above. Prefer a file-reading tool (for example " + "`astrbot_file_read_tool`) that is available in the current turn " + "and permitted for the current user. If no such file-reading tool " + "is available and shell execution is available and permitted, " + "use a command compatible with the current runtime shell " + f"(e.g. `{example_command}`). If neither method is " + "available and permitted, state that you cannot load the skill " + "and do not call unavailable or denied tools. " "Never rely on memory or assumptions about a skill's content.\n" "4. **Progressive disclosure** — Load only what is directly " "referenced from `SKILL.md`:\n" From 3046b101a958a085125e28faab7ebcd4c62d982f Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 26 Oct 2026 23:48:02 +0800 Subject: [PATCH 2/2] fix: simplify skill reading instructions --- astrbot/core/skills/skill_manager.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/astrbot/core/skills/skill_manager.py b/astrbot/core/skills/skill_manager.py index c71d5e0ba84..c2fa83d74d3 100644 --- a/astrbot/core/skills/skill_manager.py +++ b/astrbot/core/skills/skill_manager.py @@ -269,14 +269,9 @@ def build_skills_prompt(skills: list[SkillInfo]) -> str: "explain why you chose not to.\n" "3. **Mandatory grounding** — Before executing any skill you MUST " "first read its `SKILL.md` in full using the **absolute path** " - "shown above. Prefer a file-reading tool (for example " - "`astrbot_file_read_tool`) that is available in the current turn " - "and permitted for the current user. If no such file-reading tool " - "is available and shell execution is available and permitted, " - "use a command compatible with the current runtime shell " - f"(e.g. `{example_command}`). If neither method is " - "available and permitted, state that you cannot load the skill " - "and do not call unavailable or denied tools. " + "shown above. Use an available, permitted file-reading tool first, " + "or an available, permitted shell command compatible with the " + f"current runtime shell (e.g. `{example_command}`). " "Never rely on memory or assumptions about a skill's content.\n" "4. **Progressive disclosure** — Load only what is directly " "referenced from `SKILL.md`:\n"