MoonshotAI / MoonshotAI/kimi-code
[Bug] Regression of #1933: picking a model + effort in the web UI still writes config.toml [thinking].effort globally, 400-ing self-hosted Qwen3.8`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
[Bug] 0.36.1 web UI 切换模型仍会把全局 [thinking].effort 写入 config.toml,导致本地 Qwen3.8(仅支持 xhigh)400 报错(#1933 回归)
问题概述
在 kimi-code 0.36.1(2026-08-14 发布)上,web UI 里切换模型(或同时调整思考强度)时,仍会把所选 effort 写入 ~/.kimi-code/config.toml 的全局 [thinking].effort。由于:
- 全局
[thinking].effort一旦设置,就覆盖所有模型别名自己的default_effort(官方文档明确); - 非 Kimi provider 会原样透传 effort、不做客户端回退(官方文档明确);
因此任何support_efforts里不含该值的模型别名都会立即报400 Unexpected reasoning effort ...——而且是这台机器上所有会话、所有无头kimi -p进程一起挂,不只是你切模型的那个会话。
受冲击最大的就是现在很流行的 Qwen3.8(如Qwen/Qwen3.8-27B-FP8):这是目前流行的开源推理模型,很多人通过 OpenAI 兼容端点(vLLM)自托管。Qwen3.8 声明support_efforts = ["low", "medium", "xhigh"]、default_effort = "xhigh"——它的最强档是xhigh,根本不接受high。所以在 web UI 里一旦切到任何默认 effort 为high的主流云模型(DeepSeek / Kimi k3),UI 就会把全局[thinking].effort写成"high",本地 Qwen3.8 别名立刻开始全部 400——包括与本会话无关的无头进程。
看起来是 #1933(feat: scope thinking effort to the current session)的会话级隔离修复,没有覆盖 web UI 这条路径。
为什么偏偏是 Qwen3.8
- Qwen3.8-27B-FP8(Qwen3 系列推理模型,目前最流行的开源模型之一)通常通过 OpenAI 兼容端点(vLLM)自托管,在 kimi-code 里配置成普通的
openai类型 provider——也就是一个非 Kimi provider。 - 它声明的思考强度体系是
support_efforts = ["low", "medium", "xhigh"]、default_effort = "xhigh":最强档是xhigh,high不在支持列表内。 - 与之搭配使用的主流云模型(DeepSeek、Kimi k3)默认 effort 是
high。在 web UI 里选到它们,就会把全局[thinking].effort = "high"写进配置;按官方文档,非 Kimi provider 会原样透传该值、无回退,于是本地 Qwen3.8 端点拒绝每一个请求:400 Unexpected reasoning effort high. Supported types are xhigh (default), medium, and low. - 净效果:任何"云模型 + 本地 Qwen3.8"混用的 kimi-code 安装,用户第一次在 web UI 切模型就会把 Qwen3.8 别名打挂——无需改任何配置、没有任何警告、UI 也无任何提示。
环境
- kimi-code CLI 0.36.1(2026-08-14 发布),web UI 为
kimi web(kimi-server-v2) ~/.kimi-code/config.toml包含:- 一个非 Kimi(OpenAI 兼容)provider:本地 vLLM 提供
Qwen/Qwen3.8-27B-FP8,别名local/qwen3.8-27b-fp8,support_efforts = ["low", "medium", "xhigh"],default_effort = "xhigh" - 一个 OpenAI provider(如 DeepSeek),
support_efforts = ["low", "high", "max"]
- 一个非 Kimi(OpenAI 兼容)provider:本地 vLLM 提供
复现步骤
- 确保
~/.kimi-code/config.toml里没有全局 effort:[thinking] enabled = true - 在 web UI 中,把会话模型切换到一个带思考强度档位的模型(如 DeepSeek "flash high" / effort
high)。 - 查看
~/.kimi-code/config.toml——全局段现在变成了:
全程没有任何 UI 弹窗、通知或设置项征求过你的同意。(web 服务器日志显示:会话 profile 变更后紧跟[thinking] enabled = true effort = "high"config updated changedFields=["thinking"]+["default_model"]两次写入。) - 用任意
support_efforts不含high的非 Kimi 别名跑一个无头调用:
→ 立即失败:kimi -p "hi" --model local/qwen3.8-27b-fp8error: failed to run prompt: provider.api_error: 400 Unexpected reasoning effort high. Supported types are xhigh (default), medium, and low. The provider rejected the configured thinking effort. Non-Kimi providers receive effort strings without client-side mapping; choose an effort supported by the selected model. For Kimi models, check support_efforts and default_effort.
期望行为
- 会话级的模型/思考强度选择应当保持会话级隔离(这正是 #1933 的意图),不得静默改写
config.toml中全机器共享的全局[thinking].effort。 - 按官方文档,
[thinking].effort是全局默认且优先于别名default_effort;非 Kimi provider 原样透传、无回退。写全局值会带来跨会话的爆炸半径,而 UI 既不解释也不确认。
实际行为
web UI 切换"模型 + effort"会把 effort 持久化到全局 [thinking];该值随后让所有 support_efforts 不含它的非 Kimi provider 全部 400。对自托管的 Qwen3.8(支持 low/medium/xhigh、默认 xhigh)来说这是必然发生的:web UI 写入的 high(DeepSeek/k3 的默认值)不在 Qwen3.8 支持列表内,于是每个 Qwen3.8 调用——包括无关的无头 kimi -p 进程——都报 400 Unexpected reasoning effort high. Supported types are xhigh (default), medium, and low.
真实影响
我们有一条无头流水线,在同一台机器上通过 kimi -p --model local/qwen3.8-27b-fp8 跑批量任务。一次普通的 web UI 切模型操作,静默写入了 [thinking].effort="high";随后 25 分钟内 30 个因子开发任务全部失败(exit=1,全是同一个针对本地 Qwen3.8 端点的 400),因为全局变更影响到了每一个新建的无头会话。我们自己没有任何别名/配置变更。
相关
- #1933(已合入,
feat: scope thinking effort to the current session)——描述的正是这个写回行为,本意就是修复它;但在 0.36.1 上(web 路径)仍然复现。 - #1051 ——
[thinking].effort缺乏 TUI/UI 反馈与请求验证手段。 - #1625 ——
fix: resolve and synchronize thinking effort(非 Kimi 与 Kimi 的 effort 路由)。 - #1923 —— 功能请求:
[thinking]表支持全局support_efforts。
备注
- 在 0.36.1 上现场复现了三次:
- 切换到不带显式 effort 的模型 → 只写
default_model,不写[thinking].effort; - 切换到"模型 + effort"组合(如 "flash high")→ 全局
[thinking].effort = "high"被写入,非 Kimi 别名立即 400。
- 切换到不带显式 effort 的模型 → 只写
- 手工移除全局
effort行后立即恢复正常(各别名回到自己的default_effort)。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the kimi-server-v2 web UI profile-change path and the config.toml update triggered by model and effort selection. Reproduce the documented web steps, then verify that session choices no longer modify global [thinking].effort and that kimi -p --model local/qwen3.8-27b-fp8 continues using its alias defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, cli, full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100