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.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
feat(effort): der Knopf neben dem Hirn, in der Optik des Hirns
purple9f5f237776b9
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsxindex 085755c3..607a0c3a 100644--- a/src/components/chat/ChatInput.tsx+++ b/src/components/chat/ChatInput.tsx@@ -1,6 +1,6 @@import { useState, useRef, useEffect, useCallback, type ReactNode } from 'react'import { motion } from 'framer-motion'-import { Send, Square, Paperclip, X, Brain, Terminal } from 'lucide-react'+import { Send, Square, Paperclip, X, Brain, Gauge, Terminal } from 'lucide-react'import { matchAgentCommands, type AgentCommand } from '../../lib/agent-commands'import { VoiceButton } from './VoiceButton'import { ApprovalDialog } from './ApprovalDialog'@@ -8,6 +8,7 @@ import { useVoiceStore } from '../../stores/voiceStore'import { useSettingsStore } from '../../stores/settingsStore'import { useModelStore } from '../../stores/modelStore'import { isThinkingCompatible, isVisionCompatible, declaredVision } from '../../lib/model-compatibility'+import { clampEffort, effortChoices, effortLabel, nextEffort, DEFAULT_EFFORT } from '../../lib/effort'import type { AgentToolCall } from '../../types/agent-mode'import type { ImageAttachment } from '../../types/chat'@@ -94,6 +95,19 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp// supportsVision, and the built-in engine's projector-on-disk answer). A// declared flag counts in both directions; models without one still fall// back to the name heuristic.+ // Reasoning effort. The rungs come from the server catalogue per model, so a+ // model that declares none gets no control at all and behaves as before. The+ // displayed rung is the CLAMPED one, because that is what goes on the wire:+ // showing 'Max' while sending 'high' would be a control that lies.+ const reasoningEffort = useSettingsStore((s) => s.settings.reasoningEffort)+ const effortLevels = activeModelMeta && 'effortLevels' in activeModelMeta ? activeModelMeta.effortLevels : undefined+ const effortDefault = activeModelMeta && 'effortDefault' in activeModelMeta ? activeModelMeta.effortDefault : undefined+ const effortSteps = effortChoices(effortLevels)+ const effortNow = clampEffort(effortLevels, reasoningEffort ?? effortDefault ?? DEFAULT_EFFORT)+ // Only while thinking is really happening. 'always' models keep their Think+ // button locked on, so the rung is live there without the button being.+ const thinkingIsOn = thinkLockedOn || (thinkingEnabled && canThink)+ const showEffort = effortSteps.length > 0 && thinkingIsOnconst serverVision = declaredVision(activeModelMeta)const canSeeImages = serverVision !== undefined ? serverVision : isVisionCompatible(activeModel)@@ -453,6 +467,22 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp<span>Think</span></button>+ {/* Reasoning effort. Same shape and size as the Think button beside+ it, because it is the same kind of statement about the same+ model; a second visual language here would read as a second+ subject. */}+ {showEffort && (+ <button+ data-testid="effort-toggle"+ onClick={() => updateSettings({ reasoningEffort: nextEffort(effortLevels, effortNow) })}+ className="flex items-center gap-1 px-1.5 py-1.5 rounded-md transition-all shrink-0 text-[0.6rem] font-medium bg-blue-500/15 text-blue-400 border border-blue-500/30"+ title={`Reasoning effort: ${effortLabel(effortNow)}. Click to cycle. Higher effort spends more output tokens.`}+ >+ <Gauge size={11} />+ <span>{effortLabel(effortNow)}</span>+ </button>+ )}+{/* View-specific actions (Docs · Plugins · Tools) */}<div className="flex flex-nowrap items-center gap-1 shrink-0">{composerActions}</div>diff --git a/src/components/models/__tests__/hints-name-real-controls.test.ts b/src/components/models/__tests__/hints-name-real-controls.test.tsindex 5e7962fc..2f2a50f4 100644--- a/src/components/models/__tests__/hints-name-real-controls.test.ts+++ b/src/components/models/__tests__/hints-name-real-controls.test.ts@@ -41,6 +41,10 @@ const modelManager = read('src/components/models/ModelManager.tsx')const settingsPage = read('src/components/settings/SettingsPage.tsx')const hardware = read('src/components/settings/HardwareSettings.tsx')const modelSelector = read('src/components/models/ModelSelector.tsx')+const chatInput = read('src/components/chat/ChatInput.tsx')+/** The effort button's OWN tooltip, pulled out of the shipped markup. */+const effortTip =+ chatInput.match(/data-testid="effort-toggle"[\s\S]{0,600}?title=\{`([^`]*)`\}/)?.[1] ?? ''const remoteRs = read('src-tauri/src/commands/remote.rs')describe('THE FIX: the ComfyUI-is-down hint names the control that exists', () => {@@ -116,6 +120,48 @@ describe('the two the sweep turned up', () => {})})+describe('the effort control in the composer says what it is and what it costs', () => {+ // New in 2.6.8, and it sits right beside the Think button, so it falls under+ // the same rule as everything above: a control's own text is a promise about+ // the screen and about the bill.++ it('the control is really there, with a stable handle for a counter-check', () => {+ expect(chatInput).toMatch(/data-testid="effort-toggle"/)+ expect(chatInput).toMatch(/<Gauge size=\{11\} \/>/)+ })++ it('its tooltip names the rung, the gesture and the price', () => {+ expect(chatInput).toMatch(+ /Reasoning effort: \$\{effortLabel\(effortNow\)\}\. Click to cycle\. Higher effort spends more output tokens\./,+ )+ })++ it('and "click to cycle" is what the button really does', () => {+ expect(chatInput).toMatch(+ /onClick=\{\(\) => updateSettings\(\{ reasoningEffort: nextEffort\(effortLevels, effortNow\) \}\)\}/,+ )+ })++ it('the label is the rung that actually goes on the wire, the clamped one', () => {+ // Showing Max while sending high would be a control that lies, on the one+ // axis where the user is paying attention because it costs money.+ expect(chatInput).toMatch(/const effortNow = clampEffort\(effortLevels, /)+ expect(chatInput).toMatch(/<span>\{effortLabel\(effortNow\)\}<\/span>/)+ })++ it('it is drawn only where it is true: a declared ladder and thinking really on', () => {+ expect(chatInput).toMatch(/const showEffort = effortSteps\.length > 0 && thinkingIsOn/)+ expect(chatInput).toMatch(/const thinkingIsOn = thinkLockedOn \|\| \(thinkingEnabled && canThink\)/)+ })++ it('and it names no control that does not exist', () => {+ // No slider, no gear, no menu: it is one button that cycles, and the+ // tooltip says exactly that.+ expect(effortTip).toMatch(/Click to cycle/)+ expect(effortTip).not.toMatch(/slider|gear|drop-?down|menu|open settings/i)+ })+})+describe('NEGATIVE CONTROL: no shipped text sends a user to a power button again', () => {const SKIP_DIRS = new Set(['node_modules', 'target', 'dist', 'build', '.git'])