fix(P1+P2): add DEDUP rule to prevent redundant skill reloads after compaction

After multiple compactions, the same skill may appear as [SKILL_PRUNED]
multiple times. Without guidance, the LLM could redundantly reload the
same skill on every turn, seeing the old markers as 'unresolved'.

Add:
- P1-DEDUP: System rule to ignore remaining markers after one reload
- P2-Dedup note: Summary reminder that markers are historical artifacts

Fixes #32106.
This commit is contained in:
Jonathan Boisson 2026-06-11 12:26:43 +02:00
parent 0b3bb832cc
commit ae07412e4b
2 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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 = (