From acba591b6ca3e4234b2c7d9fcbaeb35d4950ef57 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 1 Jul 2026 17:48:32 +0800 Subject: [PATCH] fix(tui): hide redundant Off option for always-on effort models Always-on models that expose multiple effort levels already render only the effort segments in the /model switcher, so the trailing "Off (Unsupported)" label was non-selectable clutter. Drop it for those models while keeping it for legacy boolean always-on models. --- .changeset/hide-off-always-on-effort.md | 5 +++++ apps/kimi-code/src/tui/components/dialogs/model-selector.ts | 6 ------ .../test/tui/components/dialogs/model-selector.test.ts | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 .changeset/hide-off-always-on-effort.md diff --git a/.changeset/hide-off-always-on-effort.md b/.changeset/hide-off-always-on-effort.md new file mode 100644 index 0000000000..ba34720c35 --- /dev/null +++ b/.changeset/hide-off-always-on-effort.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Hide the unsupported Off option in the /model thinking switcher for always-on models that already expose multiple effort levels. diff --git a/apps/kimi-code/src/tui/components/dialogs/model-selector.ts b/apps/kimi-code/src/tui/components/dialogs/model-selector.ts index c2308c18af..8820d46d70 100644 --- a/apps/kimi-code/src/tui/components/dialogs/model-selector.ts +++ b/apps/kimi-code/src/tui/components/dialogs/model-selector.ts @@ -374,12 +374,6 @@ export class ModelSelectorComponent extends Container implements Focusable { const segments = segmentsFor(choice.model); const active = this.effectiveEffort(choice); const rendered = segments.map((effort) => segment(effortLabel(effort), effort === active)); - // Always-on models (including effort-capable ones) additionally surface an - // unsupported Off so it's explicit that thinking cannot be disabled — same - // shape as the legacy always-on control. - if (availability === 'always-on') { - rendered.push(unavailable('Off')); - } return ` ${rendered.join(' ')}`; } } diff --git a/apps/kimi-code/test/tui/components/dialogs/model-selector.test.ts b/apps/kimi-code/test/tui/components/dialogs/model-selector.test.ts index 76658bb56e..76f0734999 100644 --- a/apps/kimi-code/test/tui/components/dialogs/model-selector.test.ts +++ b/apps/kimi-code/test/tui/components/dialogs/model-selector.test.ts @@ -363,7 +363,7 @@ describe('ModelSelectorComponent', () => { expect(onSelect).toHaveBeenLastCalledWith({ alias: 'kimi', thinking: 'off' }); }); - it('always-on effort models show an unsupported Off that cannot be selected', () => { + it('always-on effort models hide Off and clamp selection at the last effort', () => { const onSelect = vi.fn(); const picker = new ModelSelectorComponent({ models: { @@ -376,8 +376,8 @@ describe('ModelSelectorComponent', () => { }); const raw = picker.render(120).join('\n'); - // Off is rendered muted as unavailable, not as a selectable segment. - expect(raw).toContain(currentTheme.fg('textMuted', ' Off (Unsupported) ')); + // Off is not surfaced at all — the selectable segments are effort-only. + expect(raw).not.toContain('Off (Unsupported)'); // The active effort is still highlighted. expect(strip(raw)).toContain('[ High ]');