diff --git a/packages/cli/src/ui/commands/skillsCommand.test.ts b/packages/cli/src/ui/commands/skillsCommand.test.ts index 7331f31330..fb62f567b7 100644 --- a/packages/cli/src/ui/commands/skillsCommand.test.ts +++ b/packages/cli/src/ui/commands/skillsCommand.test.ts @@ -234,7 +234,34 @@ describe('skillsCommand', () => { expect(context.ui.addItem).toHaveBeenCalledWith( expect.objectContaining({ type: MessageType.INFO, - text: 'Skill "skill1" disabled by adding it to the disabled list in workspace (/workspace) settings. Use "/skills reload" for it to take effect.', + text: 'Skill "skill1" disabled by adding it to the disabled list in workspace (/workspace) settings. You can run "/skills reload" to refresh your current instance.', + }), + ); + }); + + it('should show reload guidance even if skill is already disabled', async () => { + const disableCmd = skillsCommand.subCommands!.find( + (s) => s.name === 'disable', + )!; + ( + context.services.settings as unknown as { merged: MergedSettings } + ).merged = createTestMergedSettings({ + skills: { enabled: true, disabled: ['skill1'] }, + }); + ( + context.services.settings as unknown as { + workspace: { settings: { skills: { disabled: string[] } } }; + } + ).workspace.settings = { + skills: { disabled: ['skill1'] }, + }; + + await disableCmd.action!(context, 'skill1'); + + expect(context.ui.addItem).toHaveBeenCalledWith( + expect.objectContaining({ + type: MessageType.INFO, + text: 'Skill "skill1" is already disabled. You can run "/skills reload" to refresh your current instance.', }), ); }); @@ -269,7 +296,7 @@ describe('skillsCommand', () => { expect(context.ui.addItem).toHaveBeenCalledWith( expect.objectContaining({ type: MessageType.INFO, - text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.', + text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. You can run "/skills reload" to refresh your current instance.', }), ); }); @@ -308,7 +335,7 @@ describe('skillsCommand', () => { expect(context.ui.addItem).toHaveBeenCalledWith( expect.objectContaining({ type: MessageType.INFO, - text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.', + text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. You can run "/skills reload" to refresh your current instance.', }), ); }); diff --git a/packages/cli/src/ui/commands/skillsCommand.ts b/packages/cli/src/ui/commands/skillsCommand.ts index ee79a6c368..46be6d86f5 100644 --- a/packages/cli/src/ui/commands/skillsCommand.ts +++ b/packages/cli/src/ui/commands/skillsCommand.ts @@ -112,8 +112,9 @@ async function disableAction( result, (label, path) => `${label} (${path})`, ); - if (result.status === 'success') { - feedback += ' Use "/skills reload" for it to take effect.'; + if (result.status === 'success' || result.status === 'no-op') { + feedback += + ' You can run "/skills reload" to refresh your current instance.'; } context.ui.addItem({ @@ -153,8 +154,9 @@ async function enableAction( result, (label, path) => `${label} (${path})`, ); - if (result.status === 'success') { - feedback += ' Use "/skills reload" for it to take effect.'; + if (result.status === 'success' || result.status === 'no-op') { + feedback += + ' You can run "/skills reload" to refresh your current instance.'; } context.ui.addItem({