MoonshotAI / MoonshotAI/kimi-code
Non-Kimi providers pass through thinking efforts outside a model's declared support_efforts (no client-side fallback)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Problem
When the configured thinking effort (global [thinking].effort, or a session-level override) is not in the selected model's declared support_efforts, only Kimi-protocol providers fall back to the model's default effort. Non-Kimi providers (openai, openai_responses, anthropic, …) pass the value through verbatim as reasoning_effort, so backends that validate the field reject every request.
Concrete report from a user: a self-hosted vLLM endpoint declares support_efforts = ["low", "medium", "xhigh"], default_effort = "xhigh". A single model switch in the web UI silently wrote effort = "high" into the global [thinking] table (which overrides every alias's own default_effort); within 25 minutes, 30 headless kimi -p tasks against that endpoint all failed with 400 Unexpected reasoning effort high. Supported types are xhigh (default), medium, and low. Removing the global effort line immediately restored service.
Expected behavior
When a model declares a support_efforts list, the client knows the valid value set; an unlisted configured effort should fall back to the model's default effort (declared default_effort, else the middle list entry — the same rule Kimi-protocol providers already use) for every provider, with a one-time warning naming the configured value and the applied fallback. Models without a declared list should keep the current pass-through behavior so their backend makes the final capability decision.
Related
- #1933 (thinking effort scoping)
- #1051, #1625, #1923 (thinking effort routing/feedback)
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
Trace how the global and session thinking effort values are resolved against a model's support_efforts before provider-specific request fields are built. Check the existing Kimi-protocol fallback and warning behavior first, then extend the shared path while preserving pass-through for models without a declared list. Done means unsupported configured efforts use the declared default or middle entry for every provider and warn once.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100