From 4178ab3c07652fe383551615333669cc73c713fa Mon Sep 17 00:00:00 2001 From: Bartok9 Date: Thu, 30 Apr 2026 03:36:44 -0400 Subject: [PATCH] fix(skills): wire bump_use() into skill invocation and preload paths (#17782) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bump_use() existed and was tested but had zero production call sites — use_count stayed 0 for all skills, breaking Curator's stale-detection logic which relies on last_used_at. Wire bump_use() into: 1. build_skill_invocation_message() — when a user invokes /skill-name 2. build_preloaded_skills_prompt() — when a skill is preloaded at session start Both are the canonical 'a skill is actively being used' moments, distinct from 'browsing' (bump_view in skill_view tool call). Closes #17782 --- agent/skill_commands.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/agent/skill_commands.py b/agent/skill_commands.py index e878326af..ad1f03824 100644 --- a/agent/skill_commands.py +++ b/agent/skill_commands.py @@ -393,6 +393,14 @@ def build_skill_invocation_message( return f"[Failed to load skill: {skill_info['name']}]" loaded_skill, skill_dir, skill_name = loaded + + # Track active usage for Curator lifecycle management (#17782) + try: + from tools.skill_usage import bump_use + bump_use(skill_name) + except Exception: + pass # Non-critical — skill invocation proceeds regardless + activation_note = ( f'[IMPORTANT: The user has invoked the "{skill_name}" skill, indicating they want ' "you to follow its instructions. The full skill content is loaded below.]" @@ -432,6 +440,14 @@ def build_preloaded_skills_prompt( continue loaded_skill, skill_dir, skill_name = loaded + + # Track active usage for Curator lifecycle management (#17782) + try: + from tools.skill_usage import bump_use + bump_use(skill_name) + except Exception: + pass # Non-critical + activation_note = ( f'[IMPORTANT: The user launched this CLI session with the "{skill_name}" skill ' "preloaded. Treat its instructions as active guidance for the duration of this "