Skip to content

fix(prompt): include disabled skills in LRU cache key#12367

Closed
jjjojoj wants to merge 3 commits into
NousResearch:mainfrom
jjjojoj:fix/skills-cache-disabled-12294
Closed

fix(prompt): include disabled skills in LRU cache key#12367
jjjojoj wants to merge 3 commits into
NousResearch:mainfrom
jjjojoj:fix/skills-cache-disabled-12294

Conversation

@jjjojoj

@jjjojoj jjjojoj commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #12294

build_skills_system_prompt() loaded the disabled skills set after the LRU cache check. Runtime changes to skills.disabled in config.yaml silently had no effect until gateway restart, wasting ~1,700 tokens/turn on disabled skill descriptions.

Changes

  • Move get_disabled_skill_names() before the cache check
  • Add tuple(sorted(disabled)) to the cache key so any config change invalidates the cache

Test plan

  • Change skills.disabled in config.yaml → new prompt should reflect change without restart
  • Existing test_prompt_builder.py tests pass
  • py_compile verified

jjjojoj and others added 3 commits April 18, 2026 22:51
…esearch#12175)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2294)

build_skills_system_prompt() loaded disabled set AFTER the cache check,
so config changes to skills.disabled silently had no effect until restart.
Move get_disabled_skill_names() before cache check and add sorted disabled
tuple to cache key so any change invalidates the cache.
@teknium1

Copy link
Copy Markdown
Contributor

Closing as duplicate of #7473, which was submitted first and has been merged into main as PR #12645 (commit fd119a1). Credit to you for independently identifying the same root cause — your diagnosis was correct. The gateway/run.py changes bundled in this PR (reset_command guard, cron shutdown refactor) weren't in scope for the skills-cache fix; happy to review them as a separate PR if you'd like.

#12645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: disabled skills still appear in system prompt due to stale LRU cache

2 participants