fix: ghost skill P0/P1 mitigation - [SKILL_PRUNED] marker + safety rule

This commit is contained in:
Jonathan Boisson 2026-06-07 13:42:49 +00:00 committed by Teknium
parent 9b868f6f67
commit 5faef80a43
2 changed files with 13 additions and 2 deletions

View file

@ -891,7 +891,13 @@ def _summarize_tool_result_unguarded(tool_name: str, tool_args: str, tool_conten
code_preview += "..."
return f"[execute_code] `{code_preview}` ({line_count} lines output)"
if tool_name in {"skill_view", "skills_list", "skill_manage"}:
if tool_name == "skill_view":
name = args.get("name", "?")
if content_len > 5000:
return f"[skill_view] name={name} ({content_len:,} chars) [SKILL_PRUNED: content lost in compression; reload with skill_view before relying on it]"
return f"[skill_view] name={name} ({content_len:,} chars)"
if tool_name in {"skills_list", "skill_manage"}:
name = args.get("name", "?")
return f"[{tool_name}] name={name} ({content_len:,} chars)"

View file

@ -192,7 +192,12 @@ SKILLS_GUIDANCE = (
"skill with skill_manage so you can reuse it next time.\n"
"When using a skill and finding it outdated, incomplete, or wrong, "
"patch it immediately with skill_manage(action='patch') — don't wait to be asked. "
"Skills that aren't maintained become liabilities."
"Skills that aren't maintained become liabilities.\n"
"\n"
"## 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."
)
KANBAN_GUIDANCE = (