Copilot advertises reasoning_effort support for kimi-k2.7-code via its live /models API. OpenCode builds a high reasoning variant from that data and sends reasoning_effort on every chat/completions request to the Kimi endpoint. The endpoint rejects it:
reasoning_effort "high" was provided, but model kimi-k2.7-code does not support reasoning effort
What's happening
The variant builder in packages/opencode/src/plugin/github-copilot/models.ts creates a high variant unconditionally from the live API advertisement:
const efforts = remote.capabilities.supports.reasoning_effort; // ["high"] — non-empty
if (!isMsgApi && efforts?.length) {
efforts.forEach(effort => variants[effort] = {reasoningEffort: effort, ...});
}
Copilot's metadata endpoint says the model supports reasoning, but its own chat endpoint rejects it. That's a data inconsistency on Copilot's side. OpenCode can't fix that. What it can do is respect its own configured constraints.
Two things prevent a config-level fix:
-
Variant generation ignores capabilities.reasoning. Setting "reasoning": false or "capabilities": { "reasoning": false } in opencode.json changes the model's capabilities.reasoning field but doesn't stop the variant from being built — the variant loop reads the live API, not the resolved capabilities object.
-
The copilot send path doesn't gate on capabilities.reasoning. Unlike the generic OpenAI transform (OpenAIChat.lowerOptions), which checks capabilities.reasoning and returns early if false, the copilot chat/completions path sends reasoning_effort regardless. So even if the capability is correctly set to false, the parameter still goes out.
To reproduce
opencode run --model github-copilot/kimi-k2.7-code "reply with OK"
Suggested fix
Gate variant generation on the resolved capabilities.reasoning in the model builder. If the model's (possibly user-overridden) capabilities.reasoning is false, skip building effort variants — even if the live API advertises them.
Alternatively (or additionally), gate the copilot send path on capabilities.reasoning like the generic path already does.
Related
Models.dev lists reasoning: true with reasoning_options: [] for this model. That's worth correcting too, but even after fixing models.dev, OpenCode would still read the live Copilot API and rebuild the variant — so this needs a code fix.
OpenCode version: 1.18.1
OS: macOS
Workaround: a chat.params hook plugin that deletes reasoningEffort from the outgoing options for this model.
Copilot advertises
reasoning_effortsupport forkimi-k2.7-codevia its live/modelsAPI. OpenCode builds ahighreasoning variant from that data and sendsreasoning_efforton every chat/completions request to the Kimi endpoint. The endpoint rejects it:What's happening
The variant builder in
packages/opencode/src/plugin/github-copilot/models.tscreates ahighvariant unconditionally from the live API advertisement:Copilot's metadata endpoint says the model supports reasoning, but its own chat endpoint rejects it. That's a data inconsistency on Copilot's side. OpenCode can't fix that. What it can do is respect its own configured constraints.
Two things prevent a config-level fix:
Variant generation ignores
capabilities.reasoning. Setting"reasoning": falseor"capabilities": { "reasoning": false }inopencode.jsonchanges the model'scapabilities.reasoningfield but doesn't stop the variant from being built — the variant loop reads the live API, not the resolved capabilities object.The copilot send path doesn't gate on
capabilities.reasoning. Unlike the generic OpenAI transform (OpenAIChat.lowerOptions), which checkscapabilities.reasoningand returns early if false, the copilot chat/completions path sendsreasoning_effortregardless. So even if the capability is correctly set to false, the parameter still goes out.To reproduce
opencode run --model github-copilot/kimi-k2.7-code "reply with OK"Suggested fix
Gate variant generation on the resolved
capabilities.reasoningin the model builder. If the model's (possibly user-overridden)capabilities.reasoningis false, skip building effort variants — even if the live API advertises them.Alternatively (or additionally), gate the copilot send path on
capabilities.reasoninglike the generic path already does.Related
Models.dev lists
reasoning: truewithreasoning_options: []for this model. That's worth correcting too, but even after fixing models.dev, OpenCode would still read the live Copilot API and rebuild the variant — so this needs a code fix.OpenCode version: 1.18.1
OS: macOS
Workaround: a
chat.paramshook plugin that deletesreasoningEffortfrom the outgoing options for this model.