hermes - ✅(Solved) Fix fix(curator): bump skill usage when cron jobs load skills [1 pull requests, 1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#18810Fetched 2026-05-03 04:54:10
View on GitHub
Comments
1
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Root Cause

In `agent/skill_loader.py` (or wherever the skill text injection happens), when a cron job loads attached skills via the `skills:` config, the code reads SKILL.md and injects it into the prompt but doesn't call `tools.skill_usage.bump_use(skill_name)`.

Fix Action

Fix

Call `bump_use(skill_name)` in the skill loader path for cron jobs (and any other non-interactive context like background tasks or subagents). This ensures the curator sees these skills as actively used.

PR fix notes

PR #18811: fix(cron): bump skill usage when cron jobs load skills

Description (problem / solution / changelog)

What does this PR do?

Cron jobs that reference skills via their skills: config never bumped the usage counters in .usage.json, so the curator could auto-archive skills actively used by cron jobs based on stale timestamps.

The _build_job_prompt() function calls skill_view(name) to load each skill's content, but it didn't call bump_use(skill_name) to update the usage telemetry. This meant a skill loaded exclusively by cron jobs would show zero activity and get archived by the curator's automatic transitions (90-day inactivity rule).

This fix adds bump_use(skill_name) after each successful skill load, wrapped in try/except so telemetry failures never break prompt building.

Related Issue

Fixes #18810

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • cron/scheduler.py — Added bump_use(skill_name) call after each successful skill load in _build_job_prompt() (line 776). Wrapped in try/except with DEBUG-level logging on failure.
  • tests/cron/test_scheduler.py — Added TestBuildJobPromptBumpUse class with three tests:
    • test_bump_use_called_for_loaded_skill — verifies bump is called for each valid skill
    • test_bump_use_not_called_for_missing_skill — verifies bump is skipped when skill loading fails
    • test_bump_failure_does_not_break_prompt — verifies prompt builds even if bump raises

How to Test

  1. Create a cron job with skills: ["some-skill"] configured
  2. Run the job — verify .usage.json shows updated last_used_at for that skill
  3. Alternatively, run the new tests: pytest tests/cron/test_scheduler.py::TestBuildJobPromptBumpUse -v

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass — ran full cron test suite (tests/cron/test_scheduler.py): 106 passed, 1 pre-existing failure unrelated to this change
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Ubuntu 24.04

Documentation & Housekeeping

  • I've updated relevant documentation — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A (purely Python scheduler logic)
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Changed files

  • cron/scheduler.py (modified, +7/-0)
  • tests/cron/test_scheduler.py (modified, +48/-0)
RAW_BUFFERClick to expand / collapse

Problem

The curator archives agent-created skills based on activity timestamps in .usage.json (last_used_at, last_viewed_at, last_patched_at). These counters are only bumped during interactive sessions when skill_view() or skill_manage() is called.

Cron jobs that reference skills via their skills: config never bump these counters. The skills loader in cron runs does inject the skill text, but it doesn't call the telemetry hooks (bump_use / bump_view). Result: a skill actively used by a cron job can be auto-archived by the curator as "stale".

Reproduction

  1. Create a skill with scripts referenced by a cron job
  2. Configure the cron job with skills: ["skill-name"]
  3. Never load the skill in an interactive session (so usage counters stay at 0)
  4. Run the curator — it will archive the skill despite active cron usage

Example

The `gloom-index-calculator` skill was archived by the first curator run on May 1, 2026 even though it had an active cron job using its scripts. It was one of 36 skills pruned for "staleness" during that pass.

Root Cause

In `agent/skill_loader.py` (or wherever the skill text injection happens), when a cron job loads attached skills via the `skills:` config, the code reads SKILL.md and injects it into the prompt but doesn't call `tools.skill_usage.bump_use(skill_name)`.

Fix

Call `bump_use(skill_name)` in the skill loader path for cron jobs (and any other non-interactive context like background tasks or subagents). This ensures the curator sees these skills as actively used.

extent analysis

TL;DR

Call bump_use(skill_name) in the skill loader path for cron jobs to update the usage counters and prevent auto-archiving of actively used skills.

Guidance

  • Identify the skill loader code in agent/skill_loader.py and locate the section where skills are loaded via the skills: config for cron jobs.
  • Add a call to tools.skill_usage.bump_use(skill_name) after the skill text is injected into the prompt to update the usage counters.
  • Verify that the bump_use function is correctly updating the last_used_at timestamp in the .usage.json file.
  • Test the fix by recreating the reproduction steps and checking that the skill is no longer archived by the curator.

Example

# in agent/skill_loader.py
def load_skill(skill_name):
    # ... existing code to inject skill text into the prompt ...
    tools.skill_usage.bump_use(skill_name)  # add this line to update usage counters

Notes

This fix assumes that the bump_use function is correctly implemented and updates the usage counters as expected. Additional testing may be necessary to ensure that the fix works as intended.

Recommendation

Apply the workaround by calling bump_use(skill_name) in the skill loader path for cron jobs, as this will prevent actively used skills from being auto-archived by the curator.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING