Skip to content

fix(skill-commands): rescan cache when platform changes#14570

Closed
LeonSGP43 wants to merge 2 commits into
NousResearch:mainfrom
LeonSGP43:fix/skill-commands-platform-cache-14536
Closed

fix(skill-commands): rescan cache when platform changes#14570
LeonSGP43 wants to merge 2 commits into
NousResearch:mainfrom
LeonSGP43:fix/skill-commands-platform-cache-14536

Conversation

@LeonSGP43
Copy link
Copy Markdown
Contributor

Summary

  • rescan cached skill commands when the effective Hermes platform changes
  • keep disabled-skill filtering aligned with the current platform-scoped config
  • add a regression test that switches HERMES_PLATFORM within one process

Testing

  • python3 -m pytest -o addopts='' tests/agent/test_skill_commands.py -q

Closes #14536

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder tool/skills Skills system (list, view, manage) labels Apr 23, 2026
@LeonSGP43 LeonSGP43 force-pushed the fix/skill-commands-platform-cache-14536 branch from 44de36f to 58e6b40 Compare April 24, 2026 17:05
@teknium1
Copy link
Copy Markdown
Contributor

teknium1 commented May 2, 2026

Salvaged as #18739 with you as co-author. Thanks for the clean rescan-on-platform-change approach — it was the only one of three parallel PRs that actually fixes the issue's repro. Closing this branch to avoid merge-conflict confusion.

@teknium1 teknium1 closed this May 2, 2026
teknium1 added a commit that referenced this pull request May 2, 2026
…18739)

The process-global `_skill_commands` dict in agent/skill_commands.py
was seeded by whichever platform scanned first, and
`get_skill_commands()` only rescanned when the cache was empty. In a
long-lived gateway process serving multiple platforms (Telegram +
Discord + Slack), the first platform's
`skills.platform_disabled` view was silently inherited by the
others — so a skill disabled for Telegram would also disappear from
Discord's slash menu, and vice versa.

Track the platform scope the cache was populated for
(`_skill_commands_platform`) and rescan in `get_skill_commands()`
when the currently-active platform no longer matches. Platform
resolution uses the same precedence as `_is_skill_disabled`:
`HERMES_PLATFORM` env var then `HERMES_SESSION_PLATFORM` from the
gateway session context.

Fixes #14536

Salvages #14570 by LeonSGP43.

Co-authored-by: LeonSGP <leon@sgp43.com>
nickdlkk pushed a commit to nickdlkk/hermes-agent that referenced this pull request May 11, 2026
…ousResearch#18739)

The process-global `_skill_commands` dict in agent/skill_commands.py
was seeded by whichever platform scanned first, and
`get_skill_commands()` only rescanned when the cache was empty. In a
long-lived gateway process serving multiple platforms (Telegram +
Discord + Slack), the first platform's
`skills.platform_disabled` view was silently inherited by the
others — so a skill disabled for Telegram would also disappear from
Discord's slash menu, and vice versa.

Track the platform scope the cache was populated for
(`_skill_commands_platform`) and rescan in `get_skill_commands()`
when the currently-active platform no longer matches. Platform
resolution uses the same precedence as `_is_skill_disabled`:
`HERMES_PLATFORM` env var then `HERMES_SESSION_PLATFORM` from the
gateway session context.

Fixes NousResearch#14536

Salvages NousResearch#14570 by LeonSGP43.

Co-authored-by: LeonSGP <leon@sgp43.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skill_commands cache can leak one platform's disabled-skill view into another

3 participants