fix(agent): refresh skills prompt cache when disabled skills change#7473
Closed
Dusk1e wants to merge 1 commit into
Closed
fix(agent): refresh skills prompt cache when disabled skills change#7473Dusk1e wants to merge 1 commit into
Dusk1e wants to merge 1 commit into
Conversation
Contributor
This was referenced Apr 19, 2026
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.
Cache invalidation for disabled skills in
build_skills_system_prompt()What changed
Updated the prompt cache key in
build_skills_system_prompt()to include the resolved disabled-skill set.This ensures the skills prompt is rebuilt immediately when
skills.disabledchanges inconfig.yaml, even within the same long-lived Hermes process.Why
Previously,
build_skills_system_prompt()could reuse an in-process cached skills prompt after the disabled skill configuration had changed.The root cause was that the cache key did not account for the resolved disabled-skill set. Because of that, disabling a skill in
config.yamlcould still leave that skill visible in<available_skills>until the cache was manually cleared or the process was restarted.How to reproduce
HERMES_HOME/skills/.../SKILL.md.build_skills_system_prompt()once.config.yamlto disable that skill:build_skills_system_prompt()again in the same process.Before this fix, the disabled skill still appeared in the generated skills prompt because the old cached prompt was returned.
How to verify
Run the targeted regression test:
Confirm the new regression test passes.
Then temporarily revert the cache-key change and rerun the same test:
Confirm it fails without the fix.
run the full test suite:
Regression test
Added
test_rebuilds_prompt_when_disabled_skills_changetotests/agent/test_prompt_builder.py.The test reproduces the original bug by:
skills.disabledPlatform impact
This change affects platform-neutral Python logic only.