feat(agent-acp): support config-option model + thought-level reasoning (Kimi)#2
Merged
Merged
Conversation
…g (Kimi) Kimi Code CLI advertises its model and reasoning controls as ACP `configOptions` (category "model" / "thought_level"), not the top-level `models` / `modes` that Gemini/Grok/Qwen use. As a result a host saw "model unavailable" for every Kimi run, and a neutral `reasoning` hint was silently ignored — so a reasoning model always ran its (slow) thinking pass even for one-shot structured jobs like capture enrichment. - Read the effective model from the `model` configOption when no `models.currentModelId` is advertised (startThread + one-shot listModels). New helpers: modelIdFromCapabilities, modelsFromCapabilities, modelConfigOption. - applyReasoning falls back to a thought_level/`thinking` configOption: low effort -> its OFF value, high -> its ON value, via session/set_config_option. New helper: reasoningValueForThoughtLevel. Additive + backward-compatible: only engages when the configOption exists and the existing models/modes path finds nothing. +14 tests (128 total). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
Kimi Code CLI (v0.11.0) advertises its model and thinking controls as ACP
configOptions(category: "model"andcategory: "thought_level"), not the top-levelmodels/modesthat Gemini/Grok/Qwen use. Two user-visible consequences in a downstream consumer (PwrSnap capture enrichment):models.currentModelId, which Kimi never sets →model: ""→ "model unavailable".applyReasoningonly matched ACP modes; Kimi has none, so a neutraleffort: "low"was silently dropped and the model always ran its full thinking pass. Measured against a real Kimi enrichment turn: thinking ON ≈ 54s vs OFF ≈ 8s (~6.5×) for identical output.What
modelconfigOption whenmodels.currentModelIdis absent, in bothstartThread()and the one-shotlistModels(). A host now seeskimi-code/kimi-for-coding/ label "Kimi-k2.6". New exported helpers:modelIdFromCapabilities,modelsFromCapabilities,modelConfigOption.applyReasoningfalls back to athought_level(or idthinking) configOption when no mode matches: low-effort tokens → its OFF value, high-effort → its ON value, viasession/set_config_option. New exported helper:reasoningValueForThoughtLevel.Both are additive and backward-compatible — they only engage when the relevant configOption is present and the existing
models/modespath finds no match, so Gemini/Grok/Qwen behavior is unchanged.Tests
+14 tests (128 total, all green): capability helpers, the pure
reasoningValueForThoughtLevelmapping, and one-shot integration tests asserting the model comes from the configOption, low effort issuesset_config_option {configId:"thinking", value:"off"}, and no redundant round-trip when the value already matches.pnpm build,pnpm typecheck,pnpm test,pnpm lint:licenses,pnpm lint:boundariesall pass locally.🤖 Generated with Claude Code