fix(skills): wire bump_use() into skill invocation and preload paths (#17782)#17866
Closed
vominh1919 wants to merge 1 commit into
Closed
fix(skills): wire bump_use() into skill invocation and preload paths (#17782)#17866vominh1919 wants to merge 1 commit into
vominh1919 wants to merge 1 commit into
Conversation
bump_use() in tools/skill_usage.py had zero production call sites — it was only called in tests. This meant use_count stayed at 0 and last_used_at stayed None for all skills, making the Curator's stale timer useless. Wire bump_use() into two code paths: 1. build_skill_command_message() — when user invokes /skill-name 2. build_preloaded_skills_prompt() — when skills are preloaded at session start via --skill or config Both use try/except to match the defensive pattern of bump_view(). Fixes NousResearch#17782
Collaborator
|
Likely duplicate of #17818 — same fix (wire bump_use() into skill invocation and preload paths), same files changed. |
Collaborator
|
Likely duplicate of #17818 |
Contributor
|
Duplicate of #17818 (submitted ~2 hours earlier, same two call sites in agent/skill_commands.py, same fix). Merged @Bartok9's version via salvage PR #17932. Thanks @vominh1919 for working on this — #17782 is now closed and use_count tracking is live for all three skill activation paths. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bump_use()intools/skill_usage.pyhad zero production call sites — it was only called in tests. This meant:use_countstays 0 for all skillslast_used_atstaysNoneforeverMeanwhile
bump_view()IS wired (fromskills_tool.py:1500-1501) and works correctly.Fix
Wire
bump_use()into two code paths inagent/skill_commands.py:build_skill_command_message()— when user invokes/skill-nameand the skill content is loaded for injectionbuild_preloaded_skills_prompt()— when skills are preloaded at session start via--skillflag orskills.preloadconfigBoth use
try/except Exception: passto match the defensive pattern used bybump_view().Why These Two Locations
build_skill_command_message()is the gateway entry point — called when any slash command resolves to a skillbuild_preloaded_skills_prompt()is the CLI entry point — called when skills are loaded at session startFixes #17782