Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/Marketing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AI_MODELS = [
{
src: "/badge-deepseek-logo.png",
alt: "DeepSeek",
labels: ["DeepSeek R1", "DeepSeek V3.1 Terminus"]
labels: ["DeepSeek R1"]
},
{ src: "/badge-qwen-logo.png", alt: "Qwen", labels: ["Qwen3 Coder", "Qwen3-VL"] },
{ src: "/badge-meta-logo.png", alt: "Meta", labels: ["Meta Llama"] }
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/components/ModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ export const MODEL_CONFIG: Record<string, ModelCfg> = {
requiresPro: true,
tokenLimit: 130000
},
"deepseek-v31-terminus": {
displayName: "DeepSeek V3.1 Terminus",
shortName: "DeepSeek V3.1",
badges: ["Pro", "New"],
requiresPro: true,
tokenLimit: 130000
},
"gpt-oss-120b": {
displayName: "OpenAI GPT-OSS 120B",
shortName: "GPT-OSS",
Expand Down Expand Up @@ -114,7 +107,7 @@ export const CATEGORY_MODELS = {
free: "llama-3.3-70b",
quick: "gpt-oss-120b",
reasoning_on: "deepseek-r1-0528", // R1 with thinking
reasoning_off: "deepseek-v31-terminus", // V3.1 without thinking
reasoning_off: "deepseek-r1-0528", // R1 without thinking (brain toggle temporarily disabled)
math: "qwen3-coder-480b",
image: "qwen3-vl-30b" // Qwen3-VL for image analysis
};
Expand Down
132 changes: 68 additions & 64 deletions frontend/src/components/UnifiedChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2525,39 +2525,41 @@ export function UnifiedChat() {
}
/>

{/* Thinking toggle button - only visible when reasoning model is selected */}
{(localState.model === CATEGORY_MODELS.reasoning_on ||
localState.model === CATEGORY_MODELS.reasoning_off) && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-8 w-8 p-0"
onClick={() => {
const newThinkingEnabled = !localState.thinkingEnabled;
localState.setThinkingEnabled(newThinkingEnabled);
// Switch between R1 (with thinking) and V3.1 (without)
localState.setModel(
newThinkingEnabled
? CATEGORY_MODELS.reasoning_on
: CATEGORY_MODELS.reasoning_off
);
}}
aria-label={
localState.thinkingEnabled
? "Disable thinking mode"
: "Enable thinking mode"
}
>
<Brain
className={`h-4 w-4 ${
{/* Thinking toggle button - temporarily disabled while we remove V3.1 */}
{/* eslint-disable-next-line no-constant-binary-expression */}
{false &&
(localState.model === CATEGORY_MODELS.reasoning_on ||
localState.model === CATEGORY_MODELS.reasoning_off) && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-8 w-8 p-0"
onClick={() => {
const newThinkingEnabled = !localState.thinkingEnabled;
localState.setThinkingEnabled(newThinkingEnabled);
// Switch between R1 (with thinking) and V3.1 (without)
localState.setModel(
newThinkingEnabled
? CATEGORY_MODELS.reasoning_on
: CATEGORY_MODELS.reasoning_off
);
}}
aria-label={
localState.thinkingEnabled
? "text-purple-500"
: "text-muted-foreground"
}`}
/>
</Button>
)}
? "Disable thinking mode"
: "Enable thinking mode"
}
>
<Brain
className={`h-4 w-4 ${
localState.thinkingEnabled
? "text-purple-500"
: "text-muted-foreground"
}`}
/>
</Button>
)}
Comment on lines +2528 to +2562
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Update the temporary disabling approach and outdated comments.

The current approach has several issues:

  1. Dead code pattern: Using {false && ...} with an eslint-disable leaves unreachable code in the codebase. Consider either removing the entire block or using a feature flag/constant at the module level for cleaner temporary disabling.

  2. Outdated comment: Line 2541 references "Switch between R1 (with thinking) and V3.1 (without)" but V3.1 is being removed in this PR. The comment should be updated or removed.

  3. Logic inconsistency: The condition checks for reasoning_on vs reasoning_off, but per the ModelSelector changes, both now map to the same model ID "deepseek-r1-0528". This means the toggle logic (lines 2543-2546) will always set the same model regardless of the thinking state.

Consider one of these approaches:

Option 1: Complete removal (if truly temporary)

-                        {/* Thinking toggle button - temporarily disabled while we remove V3.1 */}
-                        {/* eslint-disable-next-line no-constant-binary-expression */}
-                        {false &&
-                          (localState.model === CATEGORY_MODELS.reasoning_on ||
-                            localState.model === CATEGORY_MODELS.reasoning_off) && (
-                            <Button
-                              type="button"
-                              variant="ghost"
-                              size="sm"
-                              className="h-8 w-8 p-0"
-                              onClick={() => {
-                                const newThinkingEnabled = !localState.thinkingEnabled;
-                                localState.setThinkingEnabled(newThinkingEnabled);
-                                // Switch between R1 (with thinking) and V3.1 (without)
-                                localState.setModel(
-                                  newThinkingEnabled
-                                    ? CATEGORY_MODELS.reasoning_on
-                                    : CATEGORY_MODELS.reasoning_off
-                                );
-                              }}
-                              aria-label={
-                                localState.thinkingEnabled
-                                  ? "Disable thinking mode"
-                                  : "Enable thinking mode"
-                              }
-                            >
-                              <Brain
-                                className={`h-4 w-4 ${
-                                  localState.thinkingEnabled
-                                    ? "text-purple-500"
-                                    : "text-muted-foreground"
-                                }`}
-                              />
-                            </Button>
-                          )}

Option 2: Feature flag (if planning to re-enable)

+const ENABLE_THINKING_TOGGLE = false; // TODO: Re-enable after alternative model is added
+
 ...
-                        {/* Thinking toggle button - temporarily disabled while we remove V3.1 */}
-                        {/* eslint-disable-next-line no-constant-binary-expression */}
-                        {false &&
+                        {ENABLE_THINKING_TOGGLE &&
                           (localState.model === CATEGORY_MODELS.reasoning_on ||
                             localState.model === CATEGORY_MODELS.reasoning_off) && (
                             <Button
                               ...
-                                // Switch between R1 (with thinking) and V3.1 (without)
+                                // Toggle thinking mode for reasoning models
                                 localState.setModel(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* Thinking toggle button - temporarily disabled while we remove V3.1 */}
{/* eslint-disable-next-line no-constant-binary-expression */}
{false &&
(localState.model === CATEGORY_MODELS.reasoning_on ||
localState.model === CATEGORY_MODELS.reasoning_off) && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-8 w-8 p-0"
onClick={() => {
const newThinkingEnabled = !localState.thinkingEnabled;
localState.setThinkingEnabled(newThinkingEnabled);
// Switch between R1 (with thinking) and V3.1 (without)
localState.setModel(
newThinkingEnabled
? CATEGORY_MODELS.reasoning_on
: CATEGORY_MODELS.reasoning_off
);
}}
aria-label={
localState.thinkingEnabled
? "text-purple-500"
: "text-muted-foreground"
}`}
/>
</Button>
)}
? "Disable thinking mode"
: "Enable thinking mode"
}
>
<Brain
className={`h-4 w-4 ${
localState.thinkingEnabled
? "text-purple-500"
: "text-muted-foreground"
}`}
/>
</Button>
)}
{/* Additional UI elements can go here */}
🤖 Prompt for AI Agents
In frontend/src/components/UnifiedChat.tsx around lines 2528 to 2562, the
thinking-toggle block is left unreachable via `{false && ...}`, contains an
outdated comment about V3.1, and the toggle logic compares/sets model constants
that now map to the same ID so the switch is meaningless; either remove the
entire block (preferred if feature truly removed) or replace the `{false &&
...}` with a module-level feature flag constant (e.g. ENABLE_THINKING_TOGGLE)
and use that to conditionally render; if keeping the toggle, update/replace the
outdated comment and correct the toggle logic so it sets distinct model IDs for
thinking on vs off (or consult the updated CATEGORY_MODELS to use the correct
model constants), and remove the eslint-disable since the unreachable-code
pattern will be gone.


{/* Web search toggle button - always visible */}
<Button
Expand Down Expand Up @@ -2802,39 +2804,41 @@ export function UnifiedChat() {
}
/>

{/* Thinking toggle button - only visible when reasoning model is selected */}
{(localState.model === CATEGORY_MODELS.reasoning_on ||
localState.model === CATEGORY_MODELS.reasoning_off) && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-8 w-8 p-0"
onClick={() => {
const newThinkingEnabled = !localState.thinkingEnabled;
localState.setThinkingEnabled(newThinkingEnabled);
// Switch between R1 (with thinking) and V3.1 (without)
localState.setModel(
newThinkingEnabled
? CATEGORY_MODELS.reasoning_on
: CATEGORY_MODELS.reasoning_off
);
}}
aria-label={
localState.thinkingEnabled
? "Disable thinking mode"
: "Enable thinking mode"
}
>
<Brain
className={`h-4 w-4 ${
{/* Thinking toggle button - temporarily disabled while we remove V3.1 */}
{/* eslint-disable-next-line no-constant-binary-expression */}
{false &&
(localState.model === CATEGORY_MODELS.reasoning_on ||
localState.model === CATEGORY_MODELS.reasoning_off) && (
<Button
type="button"
variant="ghost"
size="sm"
className="h-8 w-8 p-0"
onClick={() => {
const newThinkingEnabled = !localState.thinkingEnabled;
localState.setThinkingEnabled(newThinkingEnabled);
// Switch between R1 (with thinking) and V3.1 (without)
localState.setModel(
newThinkingEnabled
? CATEGORY_MODELS.reasoning_on
: CATEGORY_MODELS.reasoning_off
);
}}
aria-label={
localState.thinkingEnabled
? "text-purple-500"
: "text-muted-foreground"
}`}
/>
</Button>
)}
? "Disable thinking mode"
: "Enable thinking mode"
}
>
<Brain
className={`h-4 w-4 ${
localState.thinkingEnabled
? "text-purple-500"
: "text-muted-foreground"
}`}
/>
</Button>
)}

{/* Web search toggle button - always visible */}
<Button
Expand Down
Loading