fix(thinking): strip schema-default echo from modelConfiguration so global thinking.* applies - #241
Merged
Merged
Conversation
…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
…-default-echo # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #226 (auto-closes on merge). Follow-up to #214.
Problem
VS Code merges our picker schema defaults into the resolved per-model
modelConfigurationon every request (resolveModelConfigurationmerges defaults in every branch), so any reasoning-capable model the user never configured arrives withreasoningEffort: "off"attached.resolveThinkingConfigtreated any deliveredmodelConfigurationas the single authority — even a value equal to the baseline — so the echoed"off"outranked the globalopencodego.thinking.*settings on every request. Diagnosis by @nickchomey in #214 (comment withchatLanguageModels.jsonevidence), verified against the VS Code source.Fix (resolver-side, Option B)
schemaDefaultsOf(schema)— extracts per-key picker defaults (same shape as VS Code'sextractSchemaDefaults).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. Returnsundefinedwhen nothing survives → workspace global wins.resolveThinkingConfignow 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 asdefaultReasoningEffort; when absent it falls back tomedium/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 compileclean;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).resolveThinkingConfig → buildPayload): 4/4 pass.mimo-v2.6-flashvia Copilot Chat): echo delivered → log showsthinkingSource=workspace, payload carriesreasoning_effort:"high", HTTP 200. Per-model picks still win (thinkingSource=modelConfiguration).Docs
docs/issues/100-20260923-issue226-thinking-default-echo.mddocs/issues/93(both halves closed), feature doc 02, CHANGELOG[Unreleased], devlog,ARCHITECTURE-MAP.md(incl. test-count table re-audit: 34 files / 466 cases)