Skip to content

fix(web): auto-enable default thinking effort when switching to an effort-capable model#1475

Open
wbxl2000 wants to merge 2 commits into
mainfrom
web/thinking-effort-autoenable
Open

fix(web): auto-enable default thinking effort when switching to an effort-capable model#1475
wbxl2000 wants to merge 2 commits into
mainfrom
web/thinking-effort-autoenable

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Follow-up to #1344

Problem

After #1344, the web composer shows multi-level thinking effort controls for effort-capable models, but switching to such a model from a model with thinking "off" leaves thinking disabled. The TUI model picker instead pre-selects the target model's default effort, so the user immediately sees the effort control.

What changed

  • Added in to encapsulate the switch behavior: when the user switches onto a different effort-capable model and the current level is "off", use the model's (or middle effort fallback).
  • Updated to use the new helper, preserving "off" only when re-selecting the current model or moving to a boolean/unsupported model.
  • Added unit tests for the new helper and existing utilities.

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.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 841b79c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39063024c3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +189 to +190
const prevModel = sid === undefined ? undefined : rawState.sessions.find((s) => s.id === sid)?.model;
const isSwitch = prevModel !== modelId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve draft selections when detecting model switches

When there is no active session (the new-session/onboarding composer), prevModel is always undefined even though the current picker value comes from draftModel or rawState.defaultModel. If the user has thinking set to off and clicks the already-current effort-capable model in the full picker, isSwitch becomes true and the next line auto-enables the model's default effort, so simply re-selecting the current draft/default model silently changes the thinking level for the first prompt instead of preserving off.

Useful? React with 👍 / 👎.

@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

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

commit: 841b79c

@wbxl2000

wbxl2000 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

@codex PTAL — this is a follow-up to #1344. CI is green.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 841b79cdc5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +189 to +190
const prevModel = sid === undefined ? undefined : rawState.sessions.find((s) => s.id === sid)?.model;
const isSwitch = prevModel !== modelId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare against the effective current model

Here prevModel is undefined in the new-session draft state, and can also be empty when a session relies on the daemon default model, even though the picker/status treats draftModel ?? defaultModel as the current selection. In those cases, clicking the already-selected effort-capable model while thinking is off makes isSwitch true and thinkingLevelForModelSwitch turns thinking back on, so re-selecting the current model no longer preserves off. Derive isSwitch from the effective current model used for display/coercion, not only from session.model.

Useful? React with 👍 / 👎.

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