Skip to content

feat: add kimi-k2.6-code-preview model support#22509

Open
bzqzheng wants to merge 1 commit intoanomalyco:devfrom
bzqzheng:feat/add-kimi-k2.6-code-preview
Open

feat: add kimi-k2.6-code-preview model support#22509
bzqzheng wants to merge 1 commit intoanomalyco:devfrom
bzqzheng:feat/add-kimi-k2.6-code-preview

Conversation

@bzqzheng
Copy link
Copy Markdown

@bzqzheng bzqzheng commented Apr 15, 2026

Issue for this PR

Relates to #22408

Type of change

  • New feature
  • Bug fix
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds client-side support for the kimi-k2.6-code-preview model so users who configure it manually (e.g. via opencode.json) receive the correct provider transforms.

Specific changes:

  • packages/opencode/src/provider/transform.ts:
    • Added kimi-k2.6-code-preview to topP() so the model receives topP: 0.95.
    • Added kimi-k2.6-code-preview to the Anthropic SDK thinking logic so thinking is enabled by default.
    • temperature() already handles kimi-k2.6-code-preview correctly via the existing k2. pattern match.
  • packages/opencode/test/tool/fixtures/models-api.json:
    • Added kimi-k2.6-code-preview fixture entries for the kimi-for-coding and opencode providers.
  • packages/console/app/src/routes/workspace/[id]/usage/graph-section.tsx:
    • Added a color mapping for kimi-k2.6-code-preview in usage graphs.

The base kimi-k2.6 model is intentionally left for a follow-up PR since its provider transforms need separate validation.

How did you verify your code works?

  • Ran bun test test/provider/ and bun test test/tool/ from packages/opencode — all tests pass.
  • The pre-push typecheck hook also passes across the workspace.

Screenshots / recordings

N/A — no UI behavior changes beyond the usage graph color mapping.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@bzqzheng bzqzheng requested a review from adamdotdevin as a code owner April 15, 2026 00:36
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 15, 2026
@bzqzheng bzqzheng force-pushed the feat/add-kimi-k2.6-code-preview branch from 41142d3 to e1a4a0a Compare April 15, 2026 00:48
@Acters
Copy link
Copy Markdown

Acters commented Apr 15, 2026

kimi's k2.6 and k2.6-code-preview are completely different models. It seems that you are mixing them up as the same thing.
Also, why are there so many changes made?
I hope this is not vibe coded slop.

@bzqzheng bzqzheng force-pushed the feat/add-kimi-k2.6-code-preview branch from e1a4a0a to 533d93e Compare April 15, 2026 00:58
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Acters
Copy link
Copy Markdown

Acters commented Apr 15, 2026

These new changes are great improvement.
Can you change it to add the normal k2.6 model alongside the k2.6-code-preview?
Also, the maintainers might not merge this soon because it is a preview model. I wonder if people are hesitant to add the model until there is a full release.
BTW, I just tested this a minute ago as I was writing this and there is an id: k2.6-code model available.
Its output seems to be better than the preview model.
Want to weigh in on this?

@bzqzheng
Copy link
Copy Markdown
Author

kimi's k2.6 and k2.6-code-preview are completely different models. It seems that you are mixing them up as the same thing. Also, why are there so many changes made? I hope this is not vibe coded slop.

re: k2.6 vs. k2.6-code-preview
updated packages/opencode/src/provider/transform.ts to use the explicit model ID kimi-k2.6-code-preview.

re: unrelated changes
upstream commit history messed up and got accidentally bundled into the branch; already rebased. also meant to open the PR as draft before the gh checks pass.

@bzqzheng
Copy link
Copy Markdown
Author

These new changes are great improvement. Can you change it to add the normal k2.6 model alongside the k2.6-code-preview? Also, the maintainers might not merge this soon because it is a preview model. I wonder if people are hesitant to add the model until there is a full release. BTW, I just tested this a minute ago as I was writing this and there is an id: k2.6-code model available. Its output seems to be better than the preview model. Want to weigh in on this?

how did you discover id k2.6-code?

@Acters
Copy link
Copy Markdown

Acters commented Apr 15, 2026

These new changes are great improvement. Can you change it to add the normal k2.6 model alongside the k2.6-code-preview? Also, the maintainers might not merge this soon because it is a preview model. I wonder if people are hesitant to add the model until there is a full release. BTW, I just tested this a minute ago as I was writing this and there is an id: k2.6-code model available. Its output seems to be better than the preview model. Want to weigh in on this?

how did you discover id k2.6-code?

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.
On the other hand, the backend might just be capturing this ID kimi-k2.6-code and directing it to the preview model.

@Acters
Copy link
Copy Markdown

Acters commented Apr 15, 2026

btw, I noticed that we have been doing non-thinking so far. Is it possible that you can do a thinking enabled variant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants