Skip to content

fix(tui): hide max effort on non-DeepSeek endpoints#1798

Merged
esengine merged 1 commit into
mainfrom
fix/hide-max-effort-on-non-deepseek-1794
May 25, 2026
Merged

fix(tui): hide max effort on non-DeepSeek endpoints#1798
esengine merged 1 commit into
mainfrom
fix/hide-max-effort-on-non-deepseek-1794

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

#1657 dropped the preset abstraction and exposed reasoning effort directly, keeping `max` as a DeepSeek-only extension that users opt into knowing standard OpenAI / vLLM / Azure reject it with 400. The TUI still advertised `max` everywhere — `/effort` argsHint, slash-arg picker, ModelPicker effort rows, /effort handler — even when the active endpoint was a third-party host that can't accept it. Users on those endpoints saw `max` in every suggestion and reported it as a preset-era leftover.

Repro (from #1794)

  1. Configure baseUrl to a non-DeepSeek endpoint (vLLM, Azure, OpenAI-compat)
  2. Run `reasonix code`, type `/` to open the slash dropdown
  3. See `/effort <low|medium|high|max>` — `max` would 400 the next call

Fix

New helper `src/cli/ui/effort-choices.ts` exposes `effortChoicesForBaseUrl(baseUrl)` (uses the existing `isDeepSeekHost` allow-list) — returns the full 4-value set on `api.deepseek.com`, drops `max` everywhere else. Wired through:

  • Slash autocomplete dropdown — `useCompletionPickers` rewrites the `/effort` spec so argsHint shows `<low|medium|high>` and argCompleter omits `max`
  • Slash-arg picker (when user types `/effort `) — same rewrite
  • ModelPicker — `effortChoices` prop drives the rendered rows
  • /effort handler — rejects `max` with the standard usage hint
  • New `effortUsageNoMax` i18n key (EN / zh-CN / de) so the error message on bad input doesn't itself name `max` as an option

`max` stays available on DeepSeek endpoints — that's the design from #1657, just no longer visible on hosts where it would crash.

Test plan

  • `tests/effort-choices.test.ts` — 5 cases (DeepSeek allow, third-party filter, null/empty, spoofing rejection, argsHint format)
  • `tests/ui-model-picker.test.tsx` — new "hides max on non-DeepSeek" + existing 9 still pass
  • `tests/slash.test.ts` — new "rejects max on non-DeepSeek" + "status omits max on non-DeepSeek" + existing 132 still pass
  • `npx tsc --noEmit` clean
  • `npm run verify` passes (lint + comment policy + full suite)

Fixes #1794

#1657 dropped the preset abstraction and exposed reasoning effort
directly, keeping `max` as a DeepSeek-only extension that users opt
into knowing standard OpenAI / vLLM / Azure reject it with 400. The
TUI still advertised `max` everywhere — `/effort` argsHint, slash-arg
picker, ModelPicker effort rows, /effort handler — even when the
active endpoint was a third-party host that can't accept it. Users
on those endpoints saw `max` in every suggestion and reported it as
a preset-era leftover (#1794).

Endpoint-aware filter: when `loop.client.baseUrl` is not api.deepseek.com,
drop `max` from the choices the TUI surfaces:
  - `/effort` argsHint and argCompleter (autocomplete + arg picker)
  - ModelPicker effort rows
  - /effort handler's accept list + status / usage message
  - new `effortUsageNoMax` i18n key (EN / zh-CN / de) so the error
    on bad input doesn't itself name `max` as an option

`max` stays available on DeepSeek endpoints — that's the design from
#1657, just no longer visible where it would 400.

Fixes #1794.
@esengine esengine merged commit 65e833f into main May 25, 2026
4 checks passed
@esengine esengine deleted the fix/hide-max-effort-on-non-deepseek-1794 branch May 25, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/preset已经没有了,tui上还有max的显示

1 participant