Skip to content

fix: set Kimi temperature when thinking is disabled#740

Draft
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/kimi-thinking-off-temperature
Draft

fix: set Kimi temperature when thinking is disabled#740
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/kimi-thinking-off-temperature

Conversation

@ktwu01

@ktwu01 ktwu01 commented Jun 14, 2026

Copy link
Copy Markdown

Related Issue

Fixes #686

Problem

When Kimi thinking is disabled, the provider sends thinking: { type: "disabled" } but does not set a temperature unless one was provided through generation kwargs. The managed Kimi coding model rejects thinking-disabled requests unless the request uses temperature: 0.6.

What changed

  • Set temperature: 0.6 on Kimi requests when thinking.type is disabled and no explicit temperature is already present.
  • Preserve explicit temperature values from caller configuration.
  • Added coverage for the default and explicit-temperature paths in the existing Kimi provider test file.
  • Added a changeset for @moonshot-ai/kosong and the CLI bundle.

Validation

  • pnpm --filter @moonshot-ai/kosong exec vitest run test/kimi.test.ts
  • pnpm --filter @moonshot-ai/kosong typecheck
  • pnpm --filter @moonshot-ai/kimi-code typecheck
  • pnpm exec oxlint --type-aware packages/kosong/src/providers/kimi.ts packages/kosong/test/kimi.test.ts
  • Read-only staged diff audit for internal identifiers and secrets: clean

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 Jun 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4102ac2

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

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/kosong Patch
@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

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.

[Bug] kimi-for-coding 在关闭 thinking 模式后报错 invalid temperature: only 0.6 is allowed

1 participant