fix(cli): sync _skill_commands after /reload-skills so Tab completion updates - #26554
Closed
zccyman wants to merge 1 commit into
Closed
fix(cli): sync _skill_commands after /reload-skills so Tab completion updates#26554zccyman wants to merge 1 commit into
zccyman wants to merge 1 commit into
Conversation
… 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
Collaborator
Contributor
Author
|
Thanks @alt-glitch for the catch. #26443 addresses the same issue (#26441) with the same approach — syncing Appreciate the thorough cross-referencing. 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #26441
Root cause:
SlashCommandCompletercaptures cli.py's module-level_skill_commandsvia a lambda at construction time. When/reload-skillscallsagent.skill_commands.reload_skills(), it updates the agent module's_skill_commandsdict, but cli.py's own module-level_skill_commandsstill 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_commandsviaget_skill_commands(). This is a 3-line addition inside the existing_reload_skills()method.Changes:
cli.py: Addget_skill_commandsto imports; add global sync afterreload_skills()calltests/cli/test_reload_skills_tab_completion.py: 2 regression tests (skill addition + removal)Test plan
python -m py_compile cli.pypython -m pytest tests/cli/test_reload_skills_tab_completion.py -v -o 'addopts='