diff --git a/src/hooks/think-mode/detector.ts b/src/hooks/think-mode/detector.ts index f67cfc703..9ef7561a9 100644 --- a/src/hooks/think-mode/detector.ts +++ b/src/hooks/think-mode/detector.ts @@ -1,7 +1,7 @@ const ENGLISH_PATTERNS = [/\bultrathink\b/i, /\bthink\b/i] const MULTILINGUAL_KEYWORDS = [ - "생각", "고민", "검토", "제대로", + "생각", "검토", "제대로", "思考", "考虑", "考慮", "思考", "考え", "熟考", "सोच", "विचार", diff --git a/src/hooks/think-mode/hook.ts b/src/hooks/think-mode/hook.ts index 017cb616a..8f2442382 100644 --- a/src/hooks/think-mode/hook.ts +++ b/src/hooks/think-mode/hook.ts @@ -1,5 +1,5 @@ import { detectThinkKeyword, extractPromptText } from "./detector" -import { getHighVariant, isAlreadyHighVariant } from "./switcher" +import { isAlreadyHighVariant } from "./switcher" import type { ThinkModeState } from "./types" import { log } from "../../shared" @@ -56,22 +56,10 @@ export function createThinkModeHook() { return } - const highVariant = getHighVariant(currentModel.modelID) - - if (highVariant) { - output.message.model = { - providerID: currentModel.providerID, - modelID: highVariant, - } - output.message.variant = "high" - state.modelSwitched = true - state.variantSet = true - log("Think mode: model switched to high variant", { - sessionID, - from: currentModel.modelID, - to: highVariant, - }) - } + output.message.variant = "high" + state.modelSwitched = false + state.variantSet = true + log("Think mode: variant set to high", { sessionID }) thinkModeState.set(sessionID, state) }, diff --git a/src/hooks/think-mode/index.test.ts b/src/hooks/think-mode/index.test.ts index e135412db..34c1ba55c 100644 --- a/src/hooks/think-mode/index.test.ts +++ b/src/hooks/think-mode/index.test.ts @@ -43,7 +43,7 @@ describe("createThinkModeHook", () => { clearThinkModeState(sessionID) }) - it("sets high variant and switches model when think keyword is present", async () => { + it("sets high variant when think keyword is present", async () => { // given const hook = createThinkModeHook() const input = createHookInput({ @@ -58,13 +58,10 @@ describe("createThinkModeHook", () => { // then expect(output.message.variant).toBe("high") - expect(output.message.model).toEqual({ - providerID: "github-copilot", - modelID: "claude-opus-4-6-high", - }) + expect(output.message.model).toBeUndefined() }) - it("supports dotted model IDs by switching to normalized high variant", async () => { + it("sets high variant for dotted model IDs", async () => { // given const hook = createThinkModeHook() const input = createHookInput({ @@ -79,10 +76,7 @@ describe("createThinkModeHook", () => { // then expect(output.message.variant).toBe("high") - expect(output.message.model).toEqual({ - providerID: "github-copilot", - modelID: "gpt-5-4-high", - }) + expect(output.message.model).toBeUndefined() }) it("skips when message variant is already set", async () => { diff --git a/src/hooks/think-mode/switcher.test.ts b/src/hooks/think-mode/switcher.test.ts index e56ec5823..e699da916 100644 --- a/src/hooks/think-mode/switcher.test.ts +++ b/src/hooks/think-mode/switcher.test.ts @@ -4,6 +4,20 @@ import { isAlreadyHighVariant, } from "./switcher" +/** + * DEPRECATION NOTICE: + * + * getHighVariant() is no longer used by the think-mode hook. + * The hook now only sets output.message.variant = "high" and lets + * OpenCode's native variant system handle the transformation. + * + * This function is kept for: + * - Potential future validation use + * - Backward compatibility for external consumers + * + * Tests verify the function still works correctly. + */ + describe("think-mode switcher", () => { describe("Model ID normalization", () => { describe("getHighVariant with dots vs hyphens", () => {