opencode-copilot-chat icon indicating copy to clipboard operation
opencode-copilot-chat copied to clipboard

[BUG] Global opencodego.thinking.* ignored: picker schema default "off" echoes back as per-model override

Open ltmoerdani opened this issue 2 months ago • 0 comments

[BUG] Global opencodego.thinking.* ignored: picker schema default "off" echoes back as per-model override

Follow-up to #214

#214 was closed by v0.7.4 (scope-robust settings read), but @nickchomey retested and the symptom is still there: global opencodego.thinking.* values never take effect, while per-model settings work on both normal chat and the Agents window. His follow-up comment with chatLanguageModels.json evidence diagnosed the mechanism, and I verified it against the VS Code source. This issue tracks the remaining root cause.

What happens

For any reasoning-capable model without an explicit per-model setting, every request arrives with modelConfiguration: { reasoningEffort: "off" }, even though the user never set anything per-model. Our resolver (resolveThinkingConfig in src/thinking/resolve.ts) treats any delivered modelConfiguration as the single authority, even when its value equals the workspace baseline. So the echoed "off" beats the global opencodego.thinking.* setting on every request.

Why the default gets echoed

Two halves, both verified:

  1. Our picker schema declares default: "off" for reasoningEffort (src/thinking/schema.ts, in effortProperty, schemaFromReasoningOptions, and genericReasoningSchema).
  2. VS Code merges schema defaults into the resolved per-model configuration on every request. From resolveModelConfiguration in src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationLogic.ts: schema defaults are merged in every branch so a value the user never explicitly set is always present in the resolved configuration.

So "user never set anything" and "user explicitly set Off" arrive looking identical, and our code cannot tell them apart.

Same default also flows through the Agents window path: the agent-host BYOK bridge reads our schema default as defaultReasoningEffort (agentHostByokLmHandler.ts).

Environment

  • Extension: 0.7.4+
  • VS Code: insiders 1.137 (reporter), affects stable too wherever resolveModelConfiguration merges defaults
  • Provider: OpenCode Go, all thinking-capable models

Fix directions

  • Stop declaring default: "off" on thinking schema properties so VS Code has nothing to echo (needs a check that the picker still paints Off as the initial display).
  • And/or treat a modelConfiguration value identical to our schema default as "no override" and fall through to global settings.

Credit

Diagnosis by @nickchomey in https://github.com/ltmoerdani/opencode-copilot-chat/issues/214#issuecomment-5585200525

ltmoerdani avatar Sep 08 '26 13:09 ltmoerdani