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] 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) },