fix(tui): hide max effort on non-DeepSeek endpoints#1798
Merged
Conversation
#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
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:
`max` stays available on DeepSeek endpoints — that's the design from #1657, just no longer visible on hosts where it would crash.
Test plan
Fixes #1794