feat: add kimi-k2.6-code-preview model support#22509
feat: add kimi-k2.6-code-preview model support#22509bzqzheng wants to merge 1 commit intoanomalyco:devfrom
Conversation
41142d3 to
e1a4a0a
Compare
|
kimi's |
e1a4a0a to
533d93e
Compare
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
These new changes are great improvement. |
re: re: unrelated changes |
how did you discover id |
As I was writing it, a thought popped in my head "wait its a preview, that would mean there might be a non-preview model" I edited my opencode.json with this: opencode.json{
"$schema": "https://opencode.ai/config.json",
"provider": {
"kimi-for-coding": {
"models": {
"Kimi K2.6": {
"id": "kimi-k2.6",
"reasoning": true,
"attachment": false,
"limit": {
"context": 262144,
"output": 32768
},
"modalities": {
"input": ["text", "image", "video"],
"output": ["text"]
},
"options": {
"interleaved": {
"field": "reasoning_content"
}
}
},
"Kimi K2.6 code preview": {
"id": "kimi-k2.6-code-preview",
"reasoning": true,
"attachment": false,
"limit": {
"context": 262144,
"output": 32768
},
"modalities": {
"input": ["text", "image", "video"],
"output": ["text"]
},
"options": {
"interleaved": {
"field": "reasoning_content"
}
}
},
"Kimi K2.6 code": {
"id": "kimi-k2.6-code",
"reasoning": true,
"attachment": false,
"limit": {
"context": 262144,
"output": 32768
},
"modalities": {
"input": ["text", "image", "video"],
"output": ["text"]
},
"options": {
"interleaved": {
"field": "reasoning_content"
}
}
}
}
}
}
}
It worked, so I gather there is some stuff happening in the backend for Kimi code that is not public yet, haha. |
|
btw, I noticed that we have been doing non-thinking so far. Is it possible that you can do a thinking enabled variant? |
Issue for this PR
Relates to #22408
Type of change
What does this PR do?
Adds client-side support for the
kimi-k2.6-code-previewmodel so users who configure it manually (e.g. viaopencode.json) receive the correct provider transforms.Specific changes:
packages/opencode/src/provider/transform.ts:kimi-k2.6-code-previewtotopP()so the model receivestopP: 0.95.kimi-k2.6-code-previewto the Anthropic SDK thinking logic so thinking is enabled by default.temperature()already handleskimi-k2.6-code-previewcorrectly via the existingk2.pattern match.packages/opencode/test/tool/fixtures/models-api.json:kimi-k2.6-code-previewfixture entries for thekimi-for-codingandopencodeproviders.packages/console/app/src/routes/workspace/[id]/usage/graph-section.tsx:kimi-k2.6-code-previewin usage graphs.The base
kimi-k2.6model is intentionally left for a follow-up PR since its provider transforms need separate validation.How did you verify your code works?
bun test test/provider/andbun test test/tool/frompackages/opencode— all tests pass.typecheckhook also passes across the workspace.Screenshots / recordings
N/A — no UI behavior changes beyond the usage graph color mapping.
Checklist