feat(agent): adaptive thinking for Kimi-family Anthropic endpoints - #67228
Closed
chouqin wants to merge 1 commit into
Closed
feat(agent): adaptive thinking for Kimi-family Anthropic endpoints#67228chouqin wants to merge 1 commit into
chouqin wants to merge 1 commit into
Conversation
Kimi's Anthropic-compatible endpoints (api.moonshot.cn/anthropic, api.kimi.com/coding) implement the adaptive thinking contract — they accept thinking.type=adaptive + output_config.effort (all of low, medium, high, xhigh, max verified live) and return thinking blocks, and the replay-validation 400s that originally motivated dropping the parameter (NousResearch#13848) no longer occur. _supports_adaptive_thinking() now returns True for Kimi-family models, so they get thinking={type: adaptive, display: summarized} + output_config.effort via ADAPTIVE_EFFORT_MAP instead of nothing, and the blanket drop of the thinking parameter for Kimi-family endpoints is removed. MiniMax and other non-adaptive third parties keep the manual budget_tokens path; Claude behavior is unchanged.
Collaborator
5 tasks
webtecnica
added a commit
to webtecnica/hermes-agent
that referenced
this pull request
Jul 19, 2026
Kimi's Anthropic-compatible endpoints (api.moonshot.cn/anthropic, api.kimi.com/coding) now implement the adaptive thinking contract (thinking.type="adaptive" + output_config.effort), and the replay-validation 400s that originally motivated dropping the thinking parameter (NousResearch#13848) no longer occur. - _supports_adaptive_thinking() returns True for Kimi-family models - Remove blanket Kimi thinking suppression in build_anthropic_kwargs() - MiniMax and other non-adaptive third parties keep the manual budget_tokens path; Claude behavior unchanged - Update tests: Kimi gets adaptive thinking, effort mapping verified Closes NousResearch#67228
Contributor
|
Implemented in #67231 — same approach: |
Contributor
|
Thanks for revisiting the Kimi contract. The current-main premise is real: Problems
Suggested changes
Automated hermes-sweeper review. |
This was referenced Jul 19, 2026
Contributor
|
Merged via PR #67606 — your commit was cherry-picked onto current main with your authorship preserved in git log (rebase-merge). Thanks for revisiting the Kimi thinking contract and for the thorough live verification across effort levels and replay shapes; combined with the replay-side fix in ddd81e9, Kimi-family endpoints now get full adaptive thinking on the Anthropic wire. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Kimi's Anthropic-compatible endpoints (api.moonshot.cn/anthropic, api.kimi.com/coding) implement the adaptive thinking contract — they accept thinking.type=adaptive + output_config.effort (all of low, medium, high, xhigh, max verified live) and return thinking blocks, and the replay-validation 400s that originally motivated dropping the parameter (#13848) no longer occur.
_supports_adaptive_thinking() now returns True for Kimi-family models, so they get thinking={type: adaptive, display: summarized} + output_config.effort via ADAPTIVE_EFFORT_MAP instead of nothing, and the blanket drop of the thinking parameter for Kimi-family endpoints is removed. MiniMax and other non-adaptive third parties keep the manual budget_tokens path; Claude behavior is unchanged.
What does this PR do?
Kimi's Anthropic-compatible endpoints (
api.moonshot.cn/anthropic,api.kimi.com/coding) implement the adaptive thinking contract. Stop dropping thethinkingparameter for the Kimi family and send it in adaptive form:Related Issue
Fixes #
Type of Change
Changes Made
_supports_adaptive_thinking()returns True for Kimi-family models →thinking={type: adaptive, display: summarized}+output_config.effortviaADAPTIVE_EFFORT_MAP(never manualbudget_tokens)thinkingparameter for Kimi-family endpoints ([Bug]: 400 error for kimi-for-coding #13848-era mitigation) is removedbudget_tokenspath; Claude behavior unchangedHow to Test
Test it against the kimi for coding endpoint:
thinking.type="adaptive"+output_config.effortin {low, medium, high, xhigh, max} → all HTTP 200 with thinking blocks;display="summarized"acceptedChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs