From f8b06e0b12bb41fd4ca840906fe20b5a4da19e49 Mon Sep 17 00:00:00 2001 From: Alessandro <155005371+3clyp50@users.noreply.github.com> Date: Wed, 8 Jul 2026 12:42:43 +0200 Subject: [PATCH] Remove legacy skill prompt cleanup Delete the empty active-skills prompt extension and its unused prompt template now that selected skills are loaded through chat history instead of protocol. Stop clearing legacy loaded_skills keys from protocol/extras in the loaded-skills hook while keeping history reattachment for compacted skill bodies. --- .../message_loop_prompts_after/AGENTS.md | 6 ++--- .../_65_include_loaded_skills.py | 3 --- plugins/_skills/AGENTS.md | 1 - .../_66_include_active_skills.py | 23 ------------------- .../prompts/agent.system.active_skills.md | 5 ---- tests/test_tool_action_contracts.py | 6 ++--- 6 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 plugins/_skills/extensions/python/message_loop_prompts_after/_66_include_active_skills.py delete mode 100644 plugins/_skills/prompts/agent.system.active_skills.md diff --git a/extensions/python/message_loop_prompts_after/AGENTS.md b/extensions/python/message_loop_prompts_after/AGENTS.md index a03541caf..d18b1c5a1 100644 --- a/extensions/python/message_loop_prompts_after/AGENTS.md +++ b/extensions/python/message_loop_prompts_after/AGENTS.md @@ -2,14 +2,14 @@ ## Purpose -- Own prompt protocol and extras appended around primary message-loop prompt construction. +- Own prompt protocol, prompt extras, and history reattachment around primary message-loop prompt construction. ## Ownership -- Ordered Python files own current datetime, skill recall/load context, agent info, parallel job status, and workdir extras injection. +- Ordered Python files own current datetime, relevant-skill hints, loaded-skill history reattachment, agent info, parallel job status, and workdir extras injection. - Explicitly loaded skill bodies belong in tool-result history with metadata so they can survive persistence and be reattached after compaction. - Explicitly loaded skill IDs are chat-wide context data, not agent-local state. -- Legacy active-skill prompt protocol injection must stay empty; selected skills are loaded through history. +- Skills must not write selected or loaded skill bodies into protocol or extras. ## Local Contracts diff --git a/extensions/python/message_loop_prompts_after/_65_include_loaded_skills.py b/extensions/python/message_loop_prompts_after/_65_include_loaded_skills.py index d7effd627..6c604005a 100644 --- a/extensions/python/message_loop_prompts_after/_65_include_loaded_skills.py +++ b/extensions/python/message_loop_prompts_after/_65_include_loaded_skills.py @@ -14,9 +14,6 @@ class IncludeLoadedSkills(Extension): if not self.agent: return - loop_data.protocol_persistent.pop("loaded_skills", None) - loop_data.extras_persistent.pop("loaded_skills", None) - skill_names = skills.get_loaded_skill_names(self.agent) if not skill_names: return diff --git a/plugins/_skills/AGENTS.md b/plugins/_skills/AGENTS.md index a1ca0d81e..eaddb8014 100644 --- a/plugins/_skills/AGENTS.md +++ b/plugins/_skills/AGENTS.md @@ -8,7 +8,6 @@ - `hooks.py` owns skill config normalization. - `api/skills_catalog.py` owns skill catalog access and loading selected skills into chat history. -- `prompts/agent.system.active_skills.md` is retained only for legacy prompt-protocol compatibility. - `webui/` owns skill settings UI and store. - `default_config.yaml`, `plugin.yaml`, `README.md`, and `LICENSE` own defaults, metadata, docs, and license. diff --git a/plugins/_skills/extensions/python/message_loop_prompts_after/_66_include_active_skills.py b/plugins/_skills/extensions/python/message_loop_prompts_after/_66_include_active_skills.py deleted file mode 100644 index ea9ced8b5..000000000 --- a/plugins/_skills/extensions/python/message_loop_prompts_after/_66_include_active_skills.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import annotations - -from helpers import skills -from agent import LoopData -from helpers.extension import Extension - - -class IncludeActiveSkills(Extension): - async def execute(self, loop_data: LoopData = LoopData(), **kwargs): - if not self.agent: - return - - protocol = loop_data.protocol_persistent - protocol.pop("active_skills", None) - - content = skills.build_active_skills_prompt(self.agent) - if not content: - return - - protocol["active_skills"] = self.agent.read_prompt( - "agent.system.active_skills.md", - skills=content, - ) diff --git a/plugins/_skills/prompts/agent.system.active_skills.md b/plugins/_skills/prompts/agent.system.active_skills.md deleted file mode 100644 index 919d8145b..000000000 --- a/plugins/_skills/prompts/agent.system.active_skills.md +++ /dev/null @@ -1,5 +0,0 @@ -## active skills -The following skills were explicitly activated for this chat. -Treat them as already loaded instructions and follow them when relevant. - -{{skills}} diff --git a/tests/test_tool_action_contracts.py b/tests/test_tool_action_contracts.py index c85e83f69..a4cb49393 100644 --- a/tests/test_tool_action_contracts.py +++ b/tests/test_tool_action_contracts.py @@ -430,8 +430,8 @@ def test_loaded_skills_extension_reattaches_missing_body_after_compaction( module = _load_loaded_skills_extension(monkeypatch, tmp_path) agent = _FakeLoadedSkillAgent() loop_data = types.SimpleNamespace( - protocol_persistent={"loaded_skills": "legacy"}, - extras_persistent={"loaded_skills": "legacy"}, + protocol_persistent={}, + extras_persistent={}, history_output=[ { "ai": False, @@ -442,8 +442,6 @@ def test_loaded_skills_extension_reattaches_missing_body_after_compaction( asyncio.run(module.IncludeLoadedSkills(agent).execute(loop_data)) - assert "loaded_skills" not in loop_data.protocol_persistent - assert "loaded_skills" not in loop_data.extras_persistent assert len(agent.added_tool_results) == 1 added = agent.added_tool_results[0] assert added["tool_name"] == "skills_tool"