From 96a80bb09b82fa344c458a81ffc7d9093bc4f145 Mon Sep 17 00:00:00 2001 From: acamq <179265037+acamq@users.noreply.github.com> Date: Sun, 8 Mar 2026 09:12:01 -0600 Subject: [PATCH 1/4] fix(think-mode): remove modelID modification, only set variant The hook was incorrectly setting output.message.model.modelID to non-existent variants like gpt-5-nano-high, causing ProviderModelNotFoundError. OpenCode's native variant system only needs the variant field - it handles the transformation automatically. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/hooks/think-mode/hook.ts | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) 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) }, From 89a4d22354a703b321e02dcef17cc4a0dafa3f42 Mon Sep 17 00:00:00 2001 From: acamq <179265037+acamq@users.noreply.github.com> Date: Sun, 8 Mar 2026 09:12:13 -0600 Subject: [PATCH 2/4] test(think-mode): update tests for variant-only behavior Update test assertions to verify hook only sets output.message.variant and no longer modifies output.message.model. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/hooks/think-mode/index.test.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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 () => { From ccd4dceaf2aa0ae36fad2279192dadae74a27230 Mon Sep 17 00:00:00 2001 From: acamq <179265037+acamq@users.noreply.github.com> Date: Sun, 8 Mar 2026 09:12:29 -0600 Subject: [PATCH 3/4] fix(think-mode): remove overly broad Korean keyword MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove '고민' from MULTILINGUAL_KEYWORDS as it triggers false positives in everyday Korean speech. The keyword '생각' (thinking) remains for intentional think-mode activation. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/hooks/think-mode/detector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = [ - "생각", "고민", "검토", "제대로", + "생각", "검토", "제대로", "思考", "考虑", "考慮", "思考", "考え", "熟考", "सोच", "विचार", From 05a5c010ab088e5e775099e35d1fba519252d37d Mon Sep 17 00:00:00 2001 From: acamq <179265037+acamq@users.noreply.github.com> Date: Sun, 8 Mar 2026 09:13:07 -0600 Subject: [PATCH 4/4] docs(think-mode): document getHighVariant deprecation Add deprecation notice explaining that getHighVariant() is no longer used by the hook. Function is kept for backward compatibility and potential future validation use. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/hooks/think-mode/switcher.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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", () => {