diff --git a/agent/context_compressor.py b/agent/context_compressor.py index 93158cee8f81..ee4d7af29858 100644 --- a/agent/context_compressor.py +++ b/agent/context_compressor.py @@ -1728,8 +1728,10 @@ This compaction should PRIORITISE preserving all information related to the focu "multiple times across this summary and the protected " "messages above/below (successive compactions). " "Reloading a skill **once** is sufficient — it remains " - "in context for the rest of the session. Do not reload " - "the same skill multiple times." + "in context for the rest of the session. " + "After reloading, **ignore any remaining [SKILL_PRUNED] markers " + "for that skill** — they are historical artifacts from previous " + "compactions and do not need further action." ) # Store for iterative updates on next compaction self._previous_summary = summary diff --git a/agent/prompt_builder.py b/agent/prompt_builder.py index 2ced932efd34..69482c8c02bc 100644 --- a/agent/prompt_builder.py +++ b/agent/prompt_builder.py @@ -180,7 +180,8 @@ SKILLS_GUIDANCE = ( "## Skill Safety Rule\n" "1. **UNAVAILABLE** — If a skill placeholder contains `[SKILL_PRUNED]`, the skill content was lost in compression and is inaccessible.\n" "2. **RELOAD** — Before performing any action that depends on a skill, re-check its content with `skill_view(name='...')` if it shows `[SKILL_PRUNED]`.\n" - "3. **WAIT** — If a skill is loading or was just pruned, wait for the reload confirmation before proceeding." + "3. **WAIT** — If a skill is loading or was just pruned, wait for the reload confirmation before proceeding.\n" + "4. **DEDUP** — After reloading a pruned skill, **ignore any remaining `[SKILL_PRUNED]` markers for that same skill** — they are historical artifacts from previous compactions and do not need further action.\n" ) KANBAN_GUIDANCE = (