Skip to content

fix(thinking): strip schema-default echo from modelConfiguration so global thinking.* applies - #241

Merged
ltmoerdani merged 2 commits into
mainfrom
fix/issue226-thinking-default-echo
Sep 23, 2026
Merged

ltmoerdani merged 2 commits into
mainfrom
fix/issue226-thinking-default-echo

Conversation

@ltmoerdani

Copy link
Copy Markdown
Owner

Fixes #226 (auto-closes on merge). Follow-up to #214.

Problem

VS Code merges our picker schema defaults into the resolved per-model modelConfiguration on every request (resolveModelConfiguration merges defaults in every branch), so any reasoning-capable model the user never configured arrives with reasoningEffort: "off" attached. resolveThinkingConfig treated any delivered modelConfiguration as the single authority — even a value equal to the baseline — so the echoed "off" outranked the global opencodego.thinking.* settings on every request. Diagnosis by @nickchomey in #214 (comment with chatLanguageModels.json evidence), verified against the VS Code source.

Fix (resolver-side, Option B)

  • schemaDefaultsOf(schema) — extracts per-key picker defaults (same shape as VS Code's extractSchemaDefaults).
  • stripSchemaDefaultEcho(override, defaults) — drops override keys whose delivered value equals the family's picker schema default; per-key, so a genuine choice beside an echo still applies. Returns undefined when nothing survives → workspace global wins.
  • resolveThinkingConfig now applies only the stripped override.

Lossless by construction: VS Code itself strips default-equal values from persisted user picks (setModelConfiguration), so a delivered value equal to the schema default can never be a genuine user choice.

Why not Option A (remove default: "off" from the schema)? Verified against VS Code source: the Agents-window host reads the schema default as defaultReasoningEffort; when absent it falls back to medium/high (resolveDefaultReasoningEffort) — removing our default would make Agents-window models think at medium/high by default (silent Go credit burn), and the picker would lose its initial Off display.

Verification

  • npm run compile clean; npm run lint (full 7-check gate) pass; 466/466 unit tests (5 new [BUG] Global opencodego.thinking.* ignored: picker schema default "off" echoes back as per-model override #226 regression tests; one test that had encoded the buggy priority updated).
  • E2E simulation of the request chain (resolveThinkingConfig → buildPayload): 4/4 pass.
  • Real-model run (Go, mimo-v2.6-flash via Copilot Chat): echo delivered → log shows thinkingSource=workspace, payload carries reasoning_effort:"high", HTTP 200. Per-model picks still win (thinkingSource=modelConfiguration).

Docs

  • New: docs/issues/100-20260923-issue226-thinking-default-echo.md
  • Updated: docs/issues/93 (both halves closed), feature doc 02, CHANGELOG [Unreleased], devlog, ARCHITECTURE-MAP.md (incl. test-count table re-audit: 34 files / 466 cases)

…lobal thinking.* applies (#226)

VS Code merges our picker schema defaults into the per-model
modelConfiguration on every request, so untouched reasoning-capable
models arrived with reasoningEffort: 'off' and resolveThinkingConfig
let that echo outrank the global opencodego.thinking.* settings
(#214 follow-up, diagnosis by @nickchomey).

resolveThinkingConfig now drops override keys equal to the family's
picker schema default (stripSchemaDefaultEcho) before applying them —
lossless, because VS Code itself strips default-equal values from
persisted user picks, so such a value can never be a genuine user
choice. Non-default per-model picks still win. Removing the schema
default instead (Option A) was rejected: the Agents-window host would
fall back to medium/high reasoning (silent Go credit burn).

Verified: compile + full lint gate, 466/466 unit tests (5 new #226
regression tests), e2e simulation, and a real-model Copilot Chat run
(echo delivered -> thinkingSource=workspace -> reasoning_effort
reaches the payload).

Fixes #226
@ltmoerdani
ltmoerdani merged commit 99ea9f9 into main Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant