diff --git a/packages/cli/src/ui/commands/effort-command.test.ts b/packages/cli/src/ui/commands/effort-command.test.ts index 9a23998ad7..b14e49b6a7 100644 --- a/packages/cli/src/ui/commands/effort-command.test.ts +++ b/packages/cli/src/ui/commands/effort-command.test.ts @@ -106,15 +106,10 @@ describe('effortCommand', () => { expect(res).toMatchObject({ messageType: 'error' }); }); - it('completes tier prefixes', async () => { - expect(await effortCommand.completion!(context, 'hi')).toEqual(['high']); - expect(await effortCommand.completion!(context, 'x')).toEqual(['xhigh']); - expect(await effortCommand.completion!(context, '')).toEqual([ - 'low', - 'medium', - 'high', - 'xhigh', - 'max', - ]); + it('does not offer tier autocompletion (tiers are hinted via argumentHint)', () => { + // No completion so bare `/effort` opens the picker instead of auto-picking + // the first tier; `/effort ` still parses in the action above. + expect(effortCommand.completion).toBeUndefined(); + expect(effortCommand.argumentHint).toBe('[low|medium|high|xhigh|max]'); }); }); diff --git a/packages/cli/src/ui/commands/effort-command.ts b/packages/cli/src/ui/commands/effort-command.ts index 51cf439dd0..edf03c34c6 100644 --- a/packages/cli/src/ui/commands/effort-command.ts +++ b/packages/cli/src/ui/commands/effort-command.ts @@ -28,13 +28,14 @@ export const effortCommand: SlashCommand = { { tiers: TIER_LIST }, ); }, + // The tiers show up as a placeholder via argumentHint rather than as + // autocompletion suggestions: bare `/effort` should open the picker dialog + // (no tier auto-selected), while `/effort ` still sets one directly. A + // completion function would surface the tiers as submenu-like entries and let + // Enter auto-pick the first one, which we don't want here. argumentHint: '[low|medium|high|xhigh|max]', kind: CommandKind.BUILT_IN, supportedModes: ['interactive', 'non_interactive', 'acp'] as const, - completion: async (_context, partialArg) => { - const prefix = partialArg.trim().toLowerCase(); - return REASONING_EFFORT_TIERS.filter((tier) => tier.startsWith(prefix)); - }, action: async ( context: CommandContext, actionArgs: string,