Skip to content

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

Closed
Bartok9 wants to merge 1 commit into
NousResearch:mainfrom
Bartok9:fix/17782-curator-bump-use-wiring
Closed

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

Conversation

@Bartok9
Copy link
Copy Markdown
Contributor

@Bartok9 Bartok9 commented Apr 30, 2026

Summary

Connects bump_use() to its intended call sites so Curator's lifecycle tracking actually works.

Problem

bump_use() in tools/skill_usage.py existed and was fully tested, but had zero production call sites. As a result:

  • use_count stayed at 0 for all skills
  • last_used_at stayed None forever
  • Curator's stale timer (30 days) couldn't distinguish used vs. unused skills
  • Every non-pinned agent-created skill would transition to stale simultaneously

Meanwhile bump_view() was correctly wired into skills_tool.py.

Fix

Wire bump_use() into the two canonical "a skill is actively being used" paths in agent/skill_commands.py:

  1. build_skill_invocation_message() — when a user invokes a /skill-name slash command and the skill content is injected into the prompt
  2. build_preloaded_skills_prompt() — when a skill is preloaded at CLI session start via hermes --skill <name>

Both calls are wrapped in try/except to remain non-critical — skill invocation proceeds regardless of usage tracking errors.

Why these paths

  • Slash command invocation = the user explicitly activated the skill to solve a task
  • Preload = the user started an entire session with this skill active
  • Both represent genuine "use" (vs. bump_view which tracks browsing/listing)

Testing

Existing test_skill_usage.py tests for bump_use pass. The function itself is well-tested; it simply had no callers.

Closes #17782

…ousResearch#17782)

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 NousResearch#17782
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder tool/skills Skills system (list, view, manage) labels Apr 30, 2026
teknium1 added a commit that referenced this pull request Apr 30, 2026
Widen #17818 to cover the dominant 'agent actively used this skill' path:
when the model calls the skill_view tool, bump use_count alongside view_count.
The slash-command and --skill preload paths (covered by the cherry-picked
commit) only catch user-initiated invocation; most skill activation happens
via the agent calling skill_view to consume an indexed skill.

Curator's stale-timer keys off last_used_at (agent/curator.py:233), so
without this wire-up agent-created skills would transition to stale
simultaneously regardless of actual use.
@teknium1
Copy link
Copy Markdown
Contributor

Salvaged and merged via PR #17932 — your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks @Bartok9! Widened slightly on top to also bump use_count when the agent calls the skill_view tool (the dominant skill-activation path), so curator's last_used_at signal tracks all three invocation paths: slash command, --skill preload, and skill_view tool call.

@teknium1 teknium1 closed this Apr 30, 2026
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
Widen NousResearch#17818 to cover the dominant 'agent actively used this skill' path:
when the model calls the skill_view tool, bump use_count alongside view_count.
The slash-command and --skill preload paths (covered by the cherry-picked
commit) only catch user-initiated invocation; most skill activation happens
via the agent calling skill_view to consume an indexed skill.

Curator's stale-timer keys off last_used_at (agent/curator.py:233), so
without this wire-up agent-created skills would transition to stale
simultaneously regardless of actual use.
nickdlkk pushed a commit to nickdlkk/hermes-agent that referenced this pull request May 11, 2026
Widen NousResearch#17818 to cover the dominant 'agent actively used this skill' path:
when the model calls the skill_view tool, bump use_count alongside view_count.
The slash-command and --skill preload paths (covered by the cherry-picked
commit) only catch user-initiated invocation; most skill activation happens
via the agent calling skill_view to consume an indexed skill.

Curator's stale-timer keys off last_used_at (agent/curator.py:233), so
without this wire-up agent-created skills would transition to stale
simultaneously regardless of actual use.
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