fix(agent): enable thinking for Kimi /coding endpoint via Anthropic Messages - #49143
www654cc-pixel wants to merge 1 commit into
Conversation
|
Hi @kshitijk4poor @teknium1 — could one of you take a look at this small fix when you have a moment?\n\nIt enables the parameter for the Kimi endpoint in , which was previously skipped for all Kimi-family providers. I validated the change directly against the live endpoint for single-turn, multi-turn replay (signed/unsigned/no thinking blocks), and tool-call conversations — all returned 200 OK.\n\nOnly one file changed (). Happy to address any feedback. |
|
Hi @kshitijk4poor @teknium1 — could one of you take a look at this small fix when you have a moment?\n\nIt enables the thinking parameter for the Kimi /coding endpoint in build_anthropic_kwargs(), which was previously skipped for all Kimi-family providers. I validated the change directly against the live https://api.kimi.com/coding/v1/messages endpoint for single-turn, multi-turn replay (signed/unsigned/no thinking blocks), and tool-call conversations — all returned 200 OK.\n\nOnly one file changed (agent/anthropic_adapter.py). Happy to address any feedback. |
…essages The Kimi /coding endpoint uses the Anthropic Messages protocol (/v1/messages). The build_anthropic_kwargs() function previously skipped sending the thinking parameter for all Kimi-family endpoints due to concerns that Kimi required reasoning_content on every replayed tool-call message in thinking mode. Empirical testing against the current Kimi /coding/v1/messages endpoint shows this is no longer the case: - Multi-turn replay with signed thinking blocks works. - Multi-turn replay with unsigned thinking blocks works. - Multi-turn replay without any thinking block works. - Tool-call conversations work correctly. Remove the Kimi exclusion so the thinking parameter is sent, enabling reasoning display for Kimi Coding Plan subscribers.
26d8ab8 to
9c40def
Compare
|
Closing this PR in favor of an issue. The fix is trivial (removes the |
The
kimi-codingprovider routessk-kimi-*keys tohttps://api.kimi.com/codingand correctly usesanthropic_messagesAPI mode. However,build_anthropic_kwargs()previously skipped thethinkingparameter for all Kimi-family endpoints due to concerns that Kimi requiredreasoning_contenton every replayed tool-call message in thinking mode.I tested directly against the live
https://api.kimi.com/coding/v1/messagesendpoint:thinking: {"type": "enabled"}returntype: "thinking"blocksKimi no longer enforces the reasoning_content requirement that motivated the original exclusion. The existing
_needs_thinking_reasoning_pad()and_manage_thinking_signatures()machinery already handles the echo-back for Kimi, so no additional changes are needed for multi-turn continuity.Testing: I applied this fix locally and confirmed that Kimi K2.6 now displays reasoning/thinking output in Hermes agent.