Files
hermes-agent/tools
John Paul Soliva 6df4571177 perf(bot-mode): the capability epoch counts the skills the model can invoke, not archived ones
`capability_fingerprint`'s skills component globbed `**/SKILL.md` raw, while every other reader of
that tree — `skills_list`/`skill_view`, the prompt's own `<available_skills>` index, `skill_count`,
`prompt_size` — walks it through `iter_skill_index_files`, which prunes EXCLUDED_SKILL_DIRS
(`.archive`, `.curator_backups`, `node_modules`, `.venv`, …) and each package's support dirs.

So the fingerprint was the only place counting an archived skill as a skill. Since a changed digest
rebuilds the stored Bot Chat system prompt, archiving a skill — or the curator writing a backup, or
a skill vendoring node_modules — re-prefilled the whole prompt cache for a prompt whose skills
section had not changed.

Measured on a 120-skill profile: 11.42ms -> 6.26ms, and it runs twice per turn (turn start and the
prompt-restore path). The surface drops 120 -> 89 entries, and all 31 dropped sit under a pruned
dir — none of them appear in the prompt index, skills_list or skill_count.

One-time effect: the digest changes once on upgrade, so each Bot Chat rebuilds and re-prefills once.
After that the epoch stops moving for churn it should never have tracked.

Regressions: installing a real skill still moves the epoch; archiving one settles and further
archived packages never move it again; no EXCLUDED_SKILL_DIRS entry can move it (parametrised over
the whole set); a curator backup and a skill's `references/` dir are both inert; and the epoch
tracks exactly what the skills walker reports. Restoring the raw glob fails 20 of the 21.

Fixes #117788

(cherry picked from commit a6b50a40e117f8afca28208541be714578bbc568)
2026-09-22 15:55:09 +05:30
..