Skip to content

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

@Glizlack

Description

@Glizlack

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

  1. Start gateway with default config
  2. Add a skill to skills.disabled in config.yaml
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions