Skip to content

feat(vscode): scope thinking effort to the current session#1951

Merged
wbxl2000 merged 1 commit into
mainfrom
feat/vscode-thinking-effort-session-scoped
Jul 20, 2026
Merged

feat(vscode): scope thinking effort to the current session#1951
wbxl2000 merged 1 commit into
mainfrom
feat/vscode-thinking-effort-session-scoped

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — the problem is explained below. This ports the TUI's thinking-effort rules from #1933 (and the switch warning from #1763 / web #1940) to the VS Code extension so both surfaces behave the same.

Problem

The VS Code extension persisted every concrete thinking effort pick to the global config.toml, including a model's highest declared tier (e.g. max). A top-tier pick therefore became the global default for every future session, and re-confirming the already-active effort rewrote the config on every click. The TUI has already moved to session-scoped behavior: the top tier is session-only, only the boolean thinking toggle is persisted for it, and unchanged picks skip the write entirely.

What changed

  • Persistence parity with the TUI (config.handler.ts): the [thinking] config patch now follows the same rules as the TUI's thinkingEffortToConfigoff persists enabled: false, on persists only enabled: true, and a concrete effort equal to the model's top declared support_efforts entry persists only enabled: true (session-only tier, applied to the live session via setThinking as before); lower tiers persist as the global default; unknown model metadata keeps the concrete effort. saveConfig reloads the config and skips the write when nothing changed.
  • Re-confirm is not an explicit choice: the webview sends a new optional effortChanged flag on the saveConfig bridge message (defaults to true, wire-compatible); when false, only the model and the boolean toggle are persisted, leaving the stored effort preference (including a hand-written config.toml value) untouched. Selecting the already-active effort in the webview now returns early without any write.
  • Top tier does not seed future sessions (settings.store.ts): a top-tier pick is no longer cached as the configured-effort seed used when switching models.
  • Cache-loss warning: when the conversation already contains user messages, the model dropdown and the thinking-effort dropdown show a note that switching models or thinking effort invalidates the existing prompt cache and suggest starting a new conversation (same copy intent as the TUI/web warnings).
  • New sessions keep following the backend-provided default_effort; the one-shot persisted-maxhigh migration from feat: scope thinking effort to the current session #1933 lives in agent-core and applies here unchanged.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. (host-side saveConfig persistence rules in bridge-handler.test.ts; webview store rules in settings-store.test.ts)
  • Ran gen-changesets skill, or this PR needs no changeset. (VS Code extension only; the app is versioned by its own release chore, per recent vscode-only PRs.)
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e77211c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@e77211c
npx https://pkg.pr.new/@moonshot-ai/kimi-code@e77211c

commit: e77211c

@wbxl2000
wbxl2000 merged commit 9223a37 into main Jul 20, 2026
15 checks passed
@wbxl2000
wbxl2000 deleted the feat/vscode-thinking-effort-session-scoped branch July 20, 2026 10:27
@wbxl2000 wbxl2000 mentioned this pull request Jul 20, 2026
5 tasks
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.

1 participant