diff --git a/desktop/src/__tests__/pages.test.tsx b/desktop/src/__tests__/pages.test.tsx index 0c60ed13..05bf4b22 100644 --- a/desktop/src/__tests__/pages.test.tsx +++ b/desktop/src/__tests__/pages.test.tsx @@ -159,7 +159,7 @@ describe('Content-only pages render without errors', () => { expect(screen.queryByText('/internal-only')).not.toBeInTheDocument() }) - it('EmptySession shows /goal as one command with argument hints, not pseudo subcommands', async () => { + it('EmptySession does not expose the paused /goal command', async () => { vi.mocked(skillsApi.list).mockResolvedValueOnce({ skills: [] }) render() @@ -168,9 +168,12 @@ describe('Content-only pages render without errors', () => { target: { value: '/goal', selectionStart: 5 }, }) - expect(await screen.findAllByText('/goal')).toHaveLength(2) - expect(screen.getByText('[ | clear]')).toBeInTheDocument() - expect(screen.getByText('Set a completion goal')).toBeInTheDocument() + await waitFor(() => { + expect(skillsApi.list).toHaveBeenCalled() + }) + expect(screen.queryByText('/goal', { selector: 'span' })).not.toBeInTheDocument() + expect(screen.queryByText('[ | clear]')).not.toBeInTheDocument() + expect(screen.queryByText('Set a completion goal')).not.toBeInTheDocument() expect(screen.queryByText('/goal status')).not.toBeInTheDocument() expect(screen.queryByText('/goal --tokens')).not.toBeInTheDocument() }) @@ -625,7 +628,7 @@ describe('Content-only pages render without errors', () => { expect(screen.getByText('Slash commands')).toBeInTheDocument() expect(screen.getByText('/clear')).toBeInTheDocument() expect(screen.getByText('/cost')).toBeInTheDocument() - expect(screen.getByText('14 more commands available. Type / to search the full command list.')).toBeInTheDocument() + expect(screen.getByText('13 more commands available. Type / to search the full command list.')).toBeInTheDocument() resetPageStores() }) diff --git a/desktop/src/components/chat/composerUtils.test.ts b/desktop/src/components/chat/composerUtils.test.ts index e74f4448..53424677 100644 --- a/desktop/src/components/chat/composerUtils.test.ts +++ b/desktop/src/components/chat/composerUtils.test.ts @@ -66,7 +66,7 @@ describe('composerUtils', () => { expect( mergeSlashCommands([ { - name: 'goal', + name: 'compact', description: '', argumentHint: '', }, @@ -74,24 +74,18 @@ describe('composerUtils', () => { ).toEqual( expect.arrayContaining([ { - name: 'goal', - description: 'Set a completion goal', - argumentHint: '[ | clear]', + name: 'compact', + description: 'Compact conversation context', }, ]), ) }) - it('keeps /goal as a single command with argument hints instead of pseudo subcommands', () => { + it('does not expose paused /goal fallback commands', () => { const commands = filterSlashCommands(mergeSlashCommands([]), 'goal') - expect( - commands.map((command) => command.name), - ).toEqual(['goal']) - expect(commands[0]).toMatchObject({ - description: 'Set a completion goal', - argumentHint: '[ | clear]', - }) + expect(commands.map((command) => command.name)).toEqual([]) + expect(mergeSlashCommands([]).map((command) => command.name)).not.toContain('goal') expect(mergeSlashCommands([]).map((command) => command.name)).not.toContain('goal status') expect(mergeSlashCommands([]).map((command) => command.name)).not.toContain('goal --tokens') }) diff --git a/desktop/src/components/chat/composerUtils.ts b/desktop/src/components/chat/composerUtils.ts index 884903d9..bda162bf 100644 --- a/desktop/src/components/chat/composerUtils.ts +++ b/desktop/src/components/chat/composerUtils.ts @@ -24,11 +24,6 @@ export const FALLBACK_SLASH_COMMANDS = [ ...SETTINGS_SLASH_COMMANDS.map(({ name, description }) => ({ name, description })), { name: 'compact', description: 'Compact conversation context' }, { name: 'clear', description: 'Clear conversation history' }, - { - name: 'goal', - description: 'Set a completion goal', - argumentHint: '[ | clear]', - }, { name: 'review', description: 'Review code changes' }, { name: 'commit', description: 'Create a git commit' }, { name: 'pr', description: 'Create a pull request' }, diff --git a/src/commands.ts b/src/commands.ts index 55c82fa7..0d8ae711 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -6,7 +6,6 @@ import btw from './commands/btw/index.js' import goodClaude from './commands/good-claude/index.js' import issue from './commands/issue/index.js' import feedback from './commands/feedback/index.js' -import goal from './commands/goal/index.js' import clear from './commands/clear/index.js' import color from './commands/color/index.js' import commit from './commands/commit.js' @@ -304,7 +303,6 @@ const COMMANDS = memoize((): Command[] => [ tag, theme, feedback, - goal, review, ultrareview, rewind, diff --git a/src/commands/headless.test.ts b/src/commands/headless.test.ts index 535656d7..115f214a 100644 --- a/src/commands/headless.test.ts +++ b/src/commands/headless.test.ts @@ -3,13 +3,13 @@ import type { Command } from '../types/command.js' import { filterCommandsForHeadlessMode } from './headless.js' describe('filterCommandsForHeadlessMode', () => { - test('keeps /goal without exposing other local-jsx UI commands', () => { + test('keeps non-interactive commands without exposing local-jsx UI commands', () => { const commands = [ { type: 'local-jsx', supportsNonInteractive: true, - name: 'goal', - description: 'Set a goal', + name: 'cost', + description: 'Show cost', load: async () => ({ call: async () => null }), }, { @@ -40,7 +40,7 @@ describe('filterCommandsForHeadlessMode', () => { ] satisfies Command[] expect(filterCommandsForHeadlessMode(commands).map(command => command.name)).toEqual([ - 'goal', + 'cost', 'review', ]) })