Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

docs(effort): der Kommentar in useChat stimmt wieder

purplef86babb86441
diff --git a/src/hooks/useChat.ts b/src/hooks/useChat.ts
index 411cfbb7..c0dbe551 100644
--- a/src/hooks/useChat.ts
+++ b/src/hooks/useChat.ts
@@ -657,10 +657,16 @@ export function useChat() {
// thinking field, so the user sees a clean answer without a
// planning preamble.
// Server-declared think capability (resolved above, alongside the
- // system-prompt injection): 'always'/'never' models get no
- // reasoning_effort at all — the upstream reasons (or not) regardless,
- // and forcing 'minimal' on an always-thinker can 4xx. 'toggle' and
- // unknown fall through to the name-heuristic + settings switch.
+ // system-prompt injection): 'always' and 'never' models get no
+ // thinking BOOLEAN, because there is no switch to report. 'toggle' and
+ // unknown fall through to the name-heuristic plus the settings switch.
+ //
+ // That is not the same as getting no reasoning_effort (2.6.8). An
+ // 'always' model whose catalogue entry declares a ladder gets the chosen
+ // rung, defaulting to high, which is what the web app has done all along.
+ // Only a model without a declared ladder keeps deciding entirely for
+ // itself. A 'never' model is declared without a ladder, so nothing
+ // reaches it either way.
const plainTextPlanner = isPlainTextPlanner(activeModel)
const useThinking: boolean | undefined = canThink
? (settings.thinkingEnabled === false && plainTextPlanner
diff --git a/src/lib/__tests__/thinking-side-surfaces.test.ts b/src/lib/__tests__/thinking-side-surfaces.test.ts
index 31070864..db668176 100644
--- a/src/lib/__tests__/thinking-side-surfaces.test.ts
+++ b/src/lib/__tests__/thinking-side-surfaces.test.ts
@@ -166,6 +166,15 @@ describe('the effort rung reaches every surface, not only chat', () => {
const agent = read('../../hooks/useAgentChat.ts')
const codex = read('../../hooks/useCodex.ts')
+ it('and the comment above it does not claim the opposite any more', () => {
+ // It used to read "'always'/'never' models get no reasoning_effort at all",
+ // which stopped being true the moment an always-model with a declared
+ // ladder started receiving the rung. A comment that contradicts the code
+ // beneath it is how the next reader reintroduces the bug.
+ expect(chat).not.toMatch(/models get no[\s\S]{0,20}reasoning_effort at all/)
+ expect(chat).toMatch(/'always' model whose catalogue entry declares a ladder gets the chosen/)
+ })
+
it('chat sends the rung and the ladder', () => {
expect(chat).toContain('reasoningEffort: settings.reasoningEffort,')
expect(chat).toMatch(/^\s*effortLevels,$/m)