Skip to content

fix(skills): wire bump_use() into skill invocation, preload, and skill_view tool (#17782 salvage)#17932

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-e2c9c7c8
Apr 30, 2026
Merged

fix(skills): wire bump_use() into skill invocation, preload, and skill_view tool (#17782 salvage)#17932
teknium1 merged 2 commits into
mainfrom
hermes/hermes-e2c9c7c8

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Salvage of #17818 by @Bartok9, widened to cover the dominant agent-initiated path.

What

bump_use() in tools/skill_usage.py had zero production call sites — use_count stayed at 0 and last_used_at stayed None for every skill. Since curator's stale timer keys off last_used_at (agent/curator.py:233), every non-pinned agent-created skill would transition to stale simultaneously regardless of actual use.

Changes

  • agent/skill_commands.py — call bump_use() from build_skill_invocation_message (slash command) and build_preloaded_skills_prompt (--skill preload). [@Bartok9's commit]
  • tools/skills_tool.py — also call bump_use() alongside the existing bump_view() in _skill_view_with_bump. This is the dominant path: the agent calling skill_view to load a skill is explicit "I'm using this skill to do work," stronger than passive system-prompt indexing. [widening]

All three bumps are wrapped in try/except — usage telemetry failures never break tool calls.

Validation

Before After
skill_view tool call view=1, use=0 view=1, use=1, last_used_at set
slash invocation use=0 use=1
preload (--skill) use=0 use=1

E2E: isolated HERMES_HOME, real agent-created skill, all three paths traced. Unit: scripts/run_tests.sh tests/tools/test_skill_usage.py tests/tools/test_skills_tool.py tests/agent/test_curator.py → 153 passed.

Closes #17782. Supersedes #17866 (same fix, submitted ~2h later) and the overlapping bump_use portion of #17598.

Bartok9 and others added 2 commits April 30, 2026 04:59
…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 #17782
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.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder tool/skills Skills system (list, view, manage) labels Apr 30, 2026
@teknium1 teknium1 merged commit ae8930a into main Apr 30, 2026
12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-e2c9c7c8 branch April 30, 2026 12:07
teknium1 added a commit that referenced this pull request Apr 30, 2026
…r status`

Alongside the existing 'least recently used' section, surface two more
rankings so users can see which of their agent-created skills actually
get exercised:

- 'most used (top 5)' — sorted by use_count descending. Hidden when every
  skill has use_count=0 (noise suppression on fresh installs).
- 'least used (top 5)' — sorted by use_count ascending. Always shown
  when the catalog is non-empty.

use_count started tracking real agent skill activation in PR #17932
(bump_use wired into skill_view tool + slash invocation + --skill
preload), so these rankings are now meaningful.

Tests: 3 new in tests/hermes_cli/test_curator_status.py — happy path
with mixed use_counts, zero-use suppression of the most-used section,
and the no-skills clean-empty case.
teknium1 added a commit that referenced this pull request Apr 30, 2026
…r status` (#18033)

Alongside the existing 'least recently used' section, surface two more
rankings so users can see which of their agent-created skills actually
get exercised:

- 'most used (top 5)' — sorted by use_count descending. Hidden when every
  skill has use_count=0 (noise suppression on fresh installs).
- 'least used (top 5)' — sorted by use_count ascending. Always shown
  when the catalog is non-empty.

use_count started tracking real agent skill activation in PR #17932
(bump_use wired into skill_view tool + slash invocation + --skill
preload), so these rankings are now meaningful.

Tests: 3 new in tests/hermes_cli/test_curator_status.py — happy path
with mixed use_counts, zero-use suppression of the most-used section,
and the no-skills clean-empty case.
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
…r status` (NousResearch#18033)

Alongside the existing 'least recently used' section, surface two more
rankings so users can see which of their agent-created skills actually
get exercised:

- 'most used (top 5)' — sorted by use_count descending. Hidden when every
  skill has use_count=0 (noise suppression on fresh installs).
- 'least used (top 5)' — sorted by use_count ascending. Always shown
  when the catalog is non-empty.

use_count started tracking real agent skill activation in PR NousResearch#17932
(bump_use wired into skill_view tool + slash invocation + --skill
preload), so these rankings are now meaningful.

Tests: 3 new in tests/hermes_cli/test_curator_status.py — happy path
with mixed use_counts, zero-use suppression of the most-used section,
and the no-skills clean-empty case.
nickdlkk pushed a commit to nickdlkk/hermes-agent that referenced this pull request May 11, 2026
…r status` (NousResearch#18033)

Alongside the existing 'least recently used' section, surface two more
rankings so users can see which of their agent-created skills actually
get exercised:

- 'most used (top 5)' — sorted by use_count descending. Hidden when every
  skill has use_count=0 (noise suppression on fresh installs).
- 'least used (top 5)' — sorted by use_count ascending. Always shown
  when the catalog is non-empty.

use_count started tracking real agent skill activation in PR NousResearch#17932
(bump_use wired into skill_view tool + slash invocation + --skill
preload), so these rankings are now meaningful.

Tests: 3 new in tests/hermes_cli/test_curator_status.py — happy path
with mixed use_counts, zero-use suppression of the most-used section,
and the no-skills clean-empty case.
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 P2 Medium — degraded but workaround exists 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