Skip to content

fix(skills): wire bump_use() into skill invocation and preload paths (#17782)#17866

Closed
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix/skill-bump-use-wiring
Closed

fix(skills): wire bump_use() into skill invocation and preload paths (#17782)#17866
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix/skill-bump-use-wiring

Conversation

@vominh1919

Copy link
Copy Markdown
Contributor

Summary

bump_use() in tools/skill_usage.py had zero production call sites — it was only called in tests. This meant:

  • use_count stays 0 for all skills
  • last_used_at stays None forever
  • Curator's stale timer (30 days) cannot distinguish "viewed" from "actively used" skills

Meanwhile bump_view() IS wired (from skills_tool.py:1500-1501) and works correctly.

Fix

Wire bump_use() into two code paths in agent/skill_commands.py:

  1. build_skill_command_message() — when user invokes /skill-name and the skill content is loaded for injection
  2. build_preloaded_skills_prompt() — when skills are preloaded at session start via --skill flag or skills.preload config

Both use try/except Exception: pass to match the defensive pattern used by bump_view().

Why These Two Locations

  • build_skill_command_message() is the gateway entry point — called when any slash command resolves to a skill
  • build_preloaded_skills_prompt() is the CLI entry point — called when skills are loaded at session start
  • Together they cover all production paths where skill content is actually used (not just viewed)

Fixes #17782

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
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #17818 — same fix (wire bump_use() into skill invocation and preload paths), same files changed.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #17818

2 similar comments
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #17818

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #17818

@teknium1

Copy link
Copy Markdown
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.

@teknium1 teknium1 closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Curator: bump_use() has zero production call sites — use_count always 0

3 participants