Skip to content

fix(cli): sync _skill_commands after /reload-skills so Tab completion updates - #26554

Closed
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/reload-skills-tab-completion
Closed

fix(cli): sync _skill_commands after /reload-skills so Tab completion updates#26554
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/reload-skills-tab-completion

Conversation

@zccyman

@zccyman zccyman commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #26441

Root cause: SlashCommandCompleter captures cli.py's module-level _skill_commands via a lambda at construction time. When /reload-skills calls agent.skill_commands.reload_skills(), it updates the agent module's _skill_commands dict, but cli.py's own module-level _skill_commands still points to the stale dict from startup. The Tab-completion lambda reads from cli.py's scope, so it never sees new/removed skills.

Fix: After reload_skills() returns, sync cli.py's module-level _skill_commands via get_skill_commands(). This is a 3-line addition inside the existing _reload_skills() method.

Changes:

  • cli.py: Add get_skill_commands to imports; add global sync after reload_skills() call
  • tests/cli/test_reload_skills_tab_completion.py: 2 regression tests (skill addition + removal)

Test plan

  • python -m py_compile cli.py
  • python -m pytest tests/cli/test_reload_skills_tab_completion.py -v -o 'addopts='

… updates

The SlashCommandCompleter captures cli.py module-level _skill_commands
via a lambda at construction.  _reload_skills() called
agent.skill_commands.reload_skills() but never updated cli.py own
_skill_commands, so the Tab-completion lambda kept seeing stale data
from startup.

Add a global _skill_commands sync via get_skill_commands() right after
reload_skills() returns.  Includes regression tests for both skill
addition and removal.

Closes NousResearch#26441
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard tool/skills Skills system (list, view, manage) duplicate This issue or pull request already exists labels May 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #26443 which fixes the same issue #26441 with the same approach (sync _skill_commands via get_skill_commands() after reload_skills()). Also see #26557 (third PR for the same fix).

@zccyman

zccyman commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @alt-glitch for the catch. #26443 addresses the same issue (#26441) with the same approach — syncing _skill_commands via get_skill_commands() after reload_skills(). Closing as duplicate.

Appreciate the thorough cross-referencing. 🙏

@zccyman zccyman closed this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard duplicate This issue or pull request already exists 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.

/reload-skills does not update Tab completion for newly installed skills

2 participants