Skip to content

fix: wire bump_use() into skill loading paths - #17865

Closed
Giggitycountless wants to merge 1 commit into
NousResearch:mainfrom
Giggitycountless:fix/wire-bump-use-skill-loading
Closed

fix: wire bump_use() into skill loading paths#17865
Giggitycountless wants to merge 1 commit into
NousResearch:mainfrom
Giggitycountless:fix/wire-bump-use-skill-loading

Conversation

@Giggitycountless

Copy link
Copy Markdown

Summary

bump_use() in tools/skill_usage.py existed and was tested, but had zero production call sitesuse_count stayed at 0 and last_used_at stayed None forever, making the Curator's stale timer unable to distinguish actively-used skills from never-used ones.

Changes

Adds bump_use() calls to two skill loading paths in agent/skill_commands.py:

  1. build_skill_invocation_message() — when a /skill slash command is resolved and its content is injected into the prompt
  2. build_preloaded_skills_prompt() — when skills are loaded via the CLI --skills flag at session start

Both calls follow the same pattern as the existing bump_view() call in skills_tool.py: wrapped in try/except Exception for best-effort operation that never breaks skill loading.

Why these paths

Per the issue's analysis, option 1 (slash command resolution) is the most precise: a skill is "used" when its content is actually injected to solve a task, not just when it's listed or browsed. The preload path is included because it represents intentional, active use of a skill for a session.

Before

$ grep -rn 'bump_use(' tools/ --include='*.py'
tools/skill_usage.py:277:def bump_use(skill_name: str) -> None:
# ← zero production call sites

# .usage.json: all skills show use_count: 0, last_used_at: null

After

# After invoking /my-skill or loading via --skills:
# .usage.json shows use_count: 1, last_used_at: <timestamp>

Fixes #17782

bump_use() in tools/skill_usage.py existed and was tested, but had
zero production call sites — use_count and last_used_at stayed at
their defaults forever, making the Curator's stale timer useless for
distinguishing actively-used skills from never-used ones.

Add bump_use() calls to:
- build_skill_invocation_message() — when a /skill slash command is
  resolved and its content is injected into the prompt
- build_preloaded_skills_prompt() — when skills are loaded via the
  CLI --skills flag at session start

Both calls are best-effort (wrapped in try/except) to never break
skill loading if the usage sidecar is unavailable.

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 runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #17818 — same fix for bump_use() zero call sites, same target file (agent/skill_commands.py).

@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

@Giggitycountless

Copy link
Copy Markdown
Author

Duplicate of #17818 — closing mine. Good to see this fix already in the pipeline! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint 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

2 participants