This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Repository navigation
fix(kosong): stop sending Kimi reasoning effort implicitly - #2499
Merged
Merged
Conversation
…effort-high # Conflicts: # packages/kosong/CHANGELOG.md # packages/kosong/tests/api_snapshot_tests/test_kimi.py # tests/core/test_create_llm.py
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Kosong’s Kimi provider and Kimi Code CLI integration so that “thinking” is controlled via thinking.type (enabled/disabled) without implicitly serializing the legacy reasoning_effort parameter, while keeping explicit legacy passthrough available for older endpoints. It also adds/updates unit and end-to-end regression tests and documents the migration path in English and Chinese release notes.
Changes:
- Kimi provider: separate
thinking_effortprovider state from wire-serialized parameters;with_thinking(...)now emitsthinking.typeand no longer auto-populatesreasoning_effort. - CLI/tests: assert request bodies omit implicit
reasoning_effort, and add clone/regression coverage to prevent reintroducing implicit legacy serialization. - Docs/changelogs: document the behavior change and how to explicitly pass legacy
reasoning_effortwhen needed.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/test_kimi_empty_tool_call_content_e2e.py | Adds CLI E2E coverage asserting Kimi requests use thinking.type and omit implicit reasoning_effort, plus session artifact checks. |
| tests/core/test_create_llm.py | Extends unit tests to assert Kimi thinking_effort state and absence of implicit reasoning_effort, plus cloning regression coverage. |
| packages/kosong/tests/api_snapshot_tests/test_kimi.py | Updates snapshot/API tests to ensure requests omit reasoning_effort when using with_thinking, and validates effort state preservation. |
| packages/kosong/src/kosong/chat_provider/kimi.py | Implements the behavior change: thinking_effort becomes independent provider state; with_thinking uses extra_body.thinking.type. |
| packages/kosong/src/kosong/chat_provider/init.py | Updates ThinkingEffort documentation to reflect Kimi’s behavior (note: wording needs a small correction). |
| packages/kosong/CHANGELOG.md | Adds an Unreleased entry describing the Kimi thinking / legacy parameter behavior change. |
| docs/zh/release-notes/changelog.md | Adds a Chinese release-note entry for the behavior change. |
| docs/zh/release-notes/breaking-changes.md | Documents the breaking change + migration guidance in Chinese. |
| docs/en/release-notes/changelog.md | Adds an English release-note entry for the behavior change. |
| docs/en/release-notes/breaking-changes.md | Documents the breaking change + migration guidance in English. |
| CHANGELOG.md | Adds a top-level Unreleased entry summarizing the change for CLI users. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+133
to
+135
| - **Kimi**: requests only serialize thinking as enabled or disabled; the | ||
| caller-provided effort remains unchanged as provider state. | ||
| - **Gemini**: ``xhigh`` and ``max`` clamp to ``high`` (no native support). |
This was referenced Jul 18, 2026
n-WN
added a commit
to n-WN/kimi-cli-contrib
that referenced
this pull request
Jul 18, 2026
- Add `default_thinking_effort` config and per-model `thinking_effort`, plus a `--thinking-effort` CLI flag (precedence: CLI > per-model > global) - Add `/effort` slash command: interactive picker when run without args, direct set via `/effort <level>`, `/effort default` to clear; the level is saved per model (falling back to the global default) and applied on reload - An explicit level implies the thinking switch: the CLI flag and the /effort command flip thinking on/off to match (`off` disables thinking), while config-file levels apply only when thinking is already on - On Kimi providers an explicit level is forwarded via the legacy `reasoning_effort` passthrough (retained by MoonshotAI#2499) so the server can actually honor it; the default path sends nothing, preserving the model's own default (its maximum thinking) Closes MoonshotAI#2501
NLPark-Cran
referenced
this pull request
in NLPark-Cran/cran-code
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thinking.typewithout automatically serializing the legacyreasoning_effortparameterreasoning_effortpassthrough for older compatible endpoints and add request-level, cloning, and CLI end-to-end regressionsTesting
env -u ANTHROPIC_BASE_URL -u ANTHROPIC_API_KEY make test-kosong(294 passed)uv run pytest tests/core/test_create_llm.py tests/core/test_kimisoul_completion_budget.py tests/e2e/test_kimi_empty_tool_call_content_e2e.py -q(45 passed)make check-kosong check-kimi-cli--print --thinkingsmoke test with request-body and session artifact inspection