fix(cli): refresh slash command list after /skills reload (#24454)

This commit is contained in:
N. Taylor Mullen 2026-04-01 12:15:27 -07:00 committed by GitHub
parent d9d51ba15b
commit 4e21e5b8a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View file

@ -61,6 +61,7 @@ export const createMockCommandContext = (
toggleCorgiMode: vi.fn(),
toggleShortcutsHelp: vi.fn(),
toggleVimEnabled: vi.fn(),
reloadCommands: vi.fn(),
openAgentConfigDialog: vi.fn(),
closeAgentConfigDialog: vi.fn(),
extensionsUpdateState: new Map(),

View file

@ -528,6 +528,7 @@ describe('skillsCommand', () => {
await actionPromise;
expect(reloadSkillsMock).toHaveBeenCalled();
expect(context.ui.reloadCommands).toHaveBeenCalled();
expect(context.ui.setPendingItem).toHaveBeenCalledWith(null);
expect(context.ui.addItem).toHaveBeenCalledWith(
expect.objectContaining({

View file

@ -285,6 +285,8 @@ async function reloadAction(
context.ui.setPendingItem(null);
}
context.ui.reloadCommands();
const afterSkills = skillManager.getSkills();
const afterNames = new Set(afterSkills.map((s) => s.name));