Bug Description
When a user changes skills.disabled in config.yaml while the gateway is running, disabled skills continue to appear in the system prompt's <available_skills> index until the gateway is restarted.
Root Cause
The in-process LRU cache in build_skills_system_prompt() (agent/prompt_builder.py) is keyed on:
- skills_dir
- external_dirs
- available_tools
- available_toolsets
- platform_hint
The disabled skills set is NOT part of the cache key. The disabled set is loaded after the cache check, so a cache hit returns the stale prompt without ever checking the current disabled list.
Impact
- Users pay unnecessary tokens per turn for disabled skill descriptions
- Config changes to
skills.disabled silently have no effect until restart
- On a typical setup (92 skills, 17 disabled), this wastes ~1,700 tokens per turn
Steps to Reproduce
- Start gateway with default config
- Add a skill to
skills.disabled in config.yaml
- Send a message — disabled skill still appears in the agent's available_skills
Fix
Move get_disabled_skill_names() before the cache check and include the sorted disabled tuple in the cache key. This way any config change automatically invalidates the cache.
PR: fix/skills-cache-includes-disabled
Bug Description
When a user changes
skills.disabledinconfig.yamlwhile the gateway is running, disabled skills continue to appear in the system prompt's<available_skills>index until the gateway is restarted.Root Cause
The in-process LRU cache in
build_skills_system_prompt()(agent/prompt_builder.py) is keyed on:The disabled skills set is NOT part of the cache key. The disabled set is loaded after the cache check, so a cache hit returns the stale prompt without ever checking the current disabled list.
Impact
skills.disabledsilently have no effect until restartSteps to Reproduce
skills.disabledin config.yamlFix
Move
get_disabled_skill_names()before the cache check and include the sorted disabled tuple in the cache key. This way any config change automatically invalidates the cache.PR:
fix/skills-cache-includes-disabled