MoonshotAI / MoonshotAI/kimi-code

bug(web): 设置 → Agent「默认开启思考」无法选择 Max(输入框模型菜单可以)

Open
#3,351 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

你运行的 Kimi Code 版本是?

0.39.1(当前 latest)

你使用的是哪个开放平台/订阅?

Kimi Code 会员 / 托管 MANAGED:KIMI-CODE/login 的 Kimi Code OAuth)

你使用的是哪个模型?

K3(kimi-code/k3

你的电脑平台是?

Microsoft Windows NT 10.0.26200.0 x64

浏览器:Chrome,本地 kimi webhttp://127.0.0.1:58627/

你遇到了什么问题?

kimi web 里,设置 → Agent →「默认开启思考」 能看到 Low / High / Max,但 Max 点了没有反应(不高亮、不切换、也不报错)。刷新页面后依旧如此。

同一页面输入框旁的 模型菜单(会话级)可以把思考强度设成 Max,当前会话显示 K3 · max,说明模型本身支持 Max,问题只出在设置页的全局默认控件。

K3 的 support_efforts["low", "high", "max"],设置页把 Max 画出来却点不动,属于死按钮。

这是 bug,不是可接受的产品设计。 用户可见控件显示 Max 为可选,点击却静默丢弃、UI 不更新,也没有任何禁用态或说明。如果全局默认不允许 Max,按钮就不该可点。

复现步骤?
  1. 使用最新 Kimi Code CLI 0.39.1/login 登录 Kimi Code 托管账号。
  2. 在终端执行 kimi web(或会话里 /web),打开本地 Web UI。
  3. 默认模型选 K3。
  4. 点侧栏左下角齿轮 → 设置 → Agent
  5. 在「默认开启思考」里点 Max
  6. 观察:无任何反馈,选中态仍停在 High(或原先那一档)。
  7. 关掉设置,点输入框右侧的 K3 · … 模型菜单,在「思考」里选 Max可以成功,按钮变为 K3 · max
期望的行为是什么?

设置里的 Max 应能被选中,并作为新会话的默认思考强度写入配置,与输入框模型菜单、以及 K3 声明的 support_efforts 一致。

最低限度:如果坚持「高于 catalog default_effort 的档位不能当全局默认」,设置页必须把 Max 禁用或隐藏,并说明原因,而不是做成点了没反应的死按钮。

根因(公开仓已能对上)

全局默认写入走 thinkingEffortToConfig。K3 档位为 low / high / max,托管 catalog 的 default_effort 一般为 high。函数把高于该默认档的选择当成 session-only:只返回 { enabled: true }不写 effort: "max"

// apps/kimi-code/src/tui/utils/thinking-config.ts
const ceiling =
  declared !== undefined && efforts.includes(declared)
    ? efforts.indexOf(declared)
    : efforts.length - 2;
if (efforts.indexOf(effort) > ceiling) return { enabled: true };

VS Code 里有同一份拷贝:apps/vscode/src/handlers/config.handler.tsthinkingConfig()

单测写死了这个映射(apps/kimi-code/test/tui/utils/thinking-config.test.ts):

  • [low, high, max] + defaultEffort: 'high' → 选 max 得到 { enabled: true }(没有 effort
  • 只有 defaultEffort: 'max' 时,Max 才会作为全局默认持久化

因此:

控件 API 结果
输入框模型菜单 会话级 setThinking('max') 成功,显示 K3 · max
设置 → 默认开启思考 [thinking].effort 全局默认 Max 被夹掉,配置仍是 high,按钮无反馈

「高于默认档不写进 config.toml」可能是为了避免新会话默认烧 Max;但 Settings UI 仍渲染可点的 Max,且失败时零反馈,这就是 bug。Web UI 源码在内部 code-app(本仓库只有 dist-web bundle),设置页的点击处理应在那边;公开仓的 clamp 是同一条规则。

补充信息
  • 这是设置页的 全局默认 控件,不是会话级模型菜单。两套 UI 行为不一致。
  • 刷新浏览器不能恢复。
  • Web UI 源码已不在本仓库(apps/kimi-web 已删,bundle 来自内部 code-app)。本 issue 只报 bug;若维护者批准且能指明正确仓库/改法,我可以再跟进。
  • 临时绕过:用输入框模型菜单设 Max,或在 ~/.kimi-code/config.toml 写:
[thinking]
enabled = true
effort = "max"
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading apps/kimi-code/src/tui/utils/thinking-config.ts and apps/vscode/src/handlers/config.handler.ts, then run apps/kimi-code/test/tui/utils/thinking-config.test.ts. The Web UI click handling is in the internal code-app rather than this repository, so locate that implementation before changing behavior. Done means the Settings control either persists Max consistently with the model menu or presents it as disabled or hidden with an explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
cli, developer-experience, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.