- {isAgentSupported ? (
- <>
- {!isGoodAtAgentMode && notGreatAtAgent}
-
- >
- ) : (
- notSupported
- )}
+ {!isGoodAtAgentMode && notGreatAtAgent}
+
@@ -201,16 +172,10 @@ export function ModeSelect() {
All tools available
- {isAgentSupported ? (
- <>
- {!isGoodAtAgentMode && notGreatAtAgent}
-
- >
- ) : (
- notSupported
- )}
+ {!isGoodAtAgentMode && notGreatAtAgent}
+
diff --git a/gui/src/redux/selectors/selectUseSystemMessageTools.test.ts b/gui/src/redux/selectors/selectUseSystemMessageTools.test.ts
deleted file mode 100644
index 600d52532..000000000
--- a/gui/src/redux/selectors/selectUseSystemMessageTools.test.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-import { ModelDescription } from "core";
-import { describe, expect, test, vi } from "vitest";
-import { RootState } from "../store";
-
-// Mock the shouldAutoEnableSystemMessageTools function
-vi.mock("core/config/shouldAutoEnableSystemMessageTools", () => ({
- shouldAutoEnableSystemMessageTools: vi.fn((model: ModelDescription) => {
- if (model.provider === "openrouter") {
- return !model.model.toLowerCase().includes("claude");
- }
- return undefined; // No auto-preference for other providers
- }),
-}));
-
-// Mock the selectSelectedChatModel selector - we'll control its return value in tests
-vi.mock("../slices/configSlice", () => ({
- selectSelectedChatModel: vi.fn(),
-}));
-
-// Import after mocking
-import { selectSelectedChatModel } from "../slices/configSlice";
-import { selectUseSystemMessageTools } from "./selectUseSystemMessageTools";
-
-describe("selectUseSystemMessageTools", () => {
- const mockSelectSelectedChatModel = selectSelectedChatModel as any;
-
- const createMockState = (manualSetting?: boolean): RootState => {
- return {
- config: {
- config: {
- experimental: {
- onlyUseSystemMessageTools: manualSetting,
- },
- },
- },
- } as any;
- };
-
- const createModel = (provider: string, model: string): ModelDescription => ({
- title: "Test Model",
- provider,
- underlyingProviderName: provider,
- model,
- });
-
- test("auto-detection takes priority: OpenRouter non-Claude returns true even with manual false", () => {
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("openrouter", "gpt-4"),
- );
- const state = createMockState(false);
- expect(selectUseSystemMessageTools(state)).toBe(true);
- });
-
- test("auto-detection takes priority: OpenRouter Claude returns false even with manual true", () => {
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("openrouter", "claude-3.5-sonnet"),
- );
- const state = createMockState(true);
- expect(selectUseSystemMessageTools(state)).toBe(false);
- });
-
- test("falls back to manual setting when no auto-preference: manual true", () => {
- mockSelectSelectedChatModel.mockReturnValue(createModel("openai", "gpt-4"));
- const state = createMockState(true);
- expect(selectUseSystemMessageTools(state)).toBe(true);
- });
-
- test("falls back to manual setting when no auto-preference: manual false", () => {
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("anthropic", "claude-3.5-sonnet"),
- );
- const state = createMockState(false);
- expect(selectUseSystemMessageTools(state)).toBe(false);
- });
-
- test("defaults to false when no auto-preference and no manual setting", () => {
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("groq", "llama-3.3-70b"),
- );
- const state = createMockState(undefined);
- expect(selectUseSystemMessageTools(state)).toBe(false);
- });
-
- test("handles missing selected model: uses manual setting", () => {
- mockSelectSelectedChatModel.mockReturnValue(undefined);
- const state = createMockState(true);
- expect(selectUseSystemMessageTools(state)).toBe(true);
- });
-
- test("handles missing selected model: defaults to false when no manual setting", () => {
- mockSelectSelectedChatModel.mockReturnValue(undefined);
- const state = createMockState(undefined);
- expect(selectUseSystemMessageTools(state)).toBe(false);
- });
-
- test("auto-enable works for various OpenRouter models", () => {
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("openrouter", "gpt-4o"),
- );
- expect(selectUseSystemMessageTools(createMockState(false))).toBe(true);
-
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("openrouter", "llama-3.3-70b"),
- );
- expect(selectUseSystemMessageTools(createMockState(false))).toBe(true);
-
- mockSelectSelectedChatModel.mockReturnValue(
- createModel("openrouter", "claude-haiku"),
- );
- expect(selectUseSystemMessageTools(createMockState(true))).toBe(false);
- });
-});
diff --git a/gui/src/redux/selectors/selectUseSystemMessageTools.ts b/gui/src/redux/selectors/selectUseSystemMessageTools.ts
deleted file mode 100644
index b5b09de0b..000000000
--- a/gui/src/redux/selectors/selectUseSystemMessageTools.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { shouldAutoEnableSystemMessageTools } from "core/config/shouldAutoEnableSystemMessageTools";
-import { selectSelectedChatModel } from "../slices/configSlice";
-import { RootState } from "../store";
-
-/**
- * Selector that determines if system message tools should be used.
- * This prioritizes auto-detection over manual configuration where we have a strong preference.
- *
- * Priority order:
- * 1. Auto-detection (if it returns true/false)
- * 2. Manual user configuration (if auto-detection returns undefined)
- * 3. Default to false
- *
- * @param state The Redux root state
- * @returns true if system message tools should be used, false otherwise
- */
-export function selectUseSystemMessageTools(state: RootState): boolean {
- const selectedModel = selectSelectedChatModel(state);
- const manualSetting =
- state.config.config.experimental?.onlyUseSystemMessageTools;
-
- // If no model is selected, fall back to manual setting or default
- if (!selectedModel) {
- return manualSetting ?? false;
- }
-
- // Check auto-detection first
- const autoSetting = shouldAutoEnableSystemMessageTools(selectedModel);
-
- // If auto-detection has a preference, use it (takes priority)
- if (autoSetting !== undefined) {
- return autoSetting;
- }
-
- // If no auto-preference, use manual setting or default to false
- return manualSetting ?? false;
-}
diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts
index dbd322357..baf7acac6 100644
--- a/gui/src/redux/thunks/streamNormalInput.ts
+++ b/gui/src/redux/thunks/streamNormalInput.ts
@@ -3,7 +3,6 @@ import { LLMFullCompletionOptions, Tool } from "core";
import { getRuleId } from "core/llm/rules/getSystemMessageWithRules";
import { ToCoreProtocol } from "core/protocol";
import { selectActiveTools } from "../selectors/selectActiveTools";
-import { selectUseSystemMessageTools } from "../selectors/selectUseSystemMessageTools";
import { selectSelectedChatModel } from "../slices/configSlice";
import {
abortStream,
@@ -105,12 +104,12 @@ export const streamNormalInput = createAsyncThunk<
// Get tools and filter them based on the selected model
const activeTools = selectActiveTools(state);
- const supportsNativeTools = modelSupportsNativeTools(selectedChatModel);
-
// Use the centralized selector to determine if system message tools should be used
- const useSystemTools = selectUseSystemMessageTools(state);
- const useNativeTools = !useSystemTools && supportsNativeTools;
- const systemToolsFramework = useSystemTools
+ const useNativeTools = state.config.config.experimental
+ ?.onlyUseSystemMessageTools
+ ? false
+ : modelSupportsNativeTools(selectedChatModel);
+ const systemToolsFramework = !useNativeTools
? new SystemMessageToolCodeblocksFramework()
: undefined;