fix(cron): bump skill usage when cron jobs load skills#19433
Merged
Conversation
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. Now _build_job_prompt() calls bump_use(skill_name) for each successfully loaded skill so the curator sees them as active.
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cron jobs that list skills via their `skills:` config now bump `last_used_at` when each skill is loaded, so the curator's stale-skill timer sees them as active instead of auto-archiving them at 90 days.
Root cause
`cron/scheduler.py` imports `tools.skills_tool.skill_view` directly and bypasses the `_skill_view_with_bump` tool-dispatch wrapper that normally calls `bump_use()` on success. v0.12.0 (#17932) wired bump into invocation / preload / skill_view tool-calls; cron was the only direct-call site missed.
Changes
Validation
`scripts/run_tests.sh tests/cron/test_scheduler.py::TestBuildJobPromptBumpUse` → 3/3 pass.
Salvaged from PR #18811 by @cdanis — cherry-picked with authorship preserved. Closes #18810.