Skip to content

feat(kimi): add k2.6-code-preview support across kimi-coding, kimi-coding-cn, and moonshot - #10751

Closed
nicoechaniz wants to merge 2 commits into
NousResearch:mainfrom
nicoechaniz:feat/kimi-k2.6-code-preview
Closed

feat(kimi): add k2.6-code-preview support across kimi-coding, kimi-coding-cn, and moonshot#10751
nicoechaniz wants to merge 2 commits into
NousResearch:mainfrom
nicoechaniz:feat/kimi-k2.6-code-preview

Conversation

@nicoechaniz

@nicoechaniz nicoechaniz commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Closes #11168

Summary

Adds first-class support for Moonshot Kimi k2.6-code-preview, including fixes for spurious validation warnings and autocomplete behavior.

What changed:

  • agent/model_metadata.py — Added explicit 256K context length fallback for k2.6-code-preview.
  • hermes_cli/models.py — Added k2.6-code-preview to _PROVIDER_MODELS for kimi-coding, kimi-coding-cn, and moonshot (prioritized first). Fixed validate_requested_model() to trust static curated lists when the live API is incomplete or unreachable.
  • hermes_cli/model_switch.py — Fixed explicit --provider resolution to use the Hermes internal provider ID (kimi-coding) instead of the models.dev ID (kimi-for-coding), preventing validation mismatches in the interactive model picker. Added built-in direct alias so /model kimi resolves to k2.6-code-preview. Prioritize curated lists over models.dev catalog in resolve_alias().
  • hermes_cli/main.py — Updated _model_flow_kimi hardcoded picker list to prioritize k2.6-code-preview for Coding Plan endpoints.
  • hermes_cli/setup.py — Updated setup-wizard default model lists to prioritize k2.6-code-preview for kimi-coding and kimi-coding-cn.
  • tests/hermes_cli/test_model_validation.py — Added coverage for the static-list fallback behavior and updated a stale provider label assertion for Kimi.

Test plan:

  • All 64 model validation tests pass.
  • k2.6-code-preview resolves correctly via /model direct input, autocomplete (/model kimi), and via the interactive model picker without spurious warnings.
  • Context length matches (256K).

Fixes spurious "not found" warnings when selecting k2.6-code-preview.

…ding-cn, and moonshot

- Add k2.6-code-preview to _PROVIDER_MODELS for kimi-coding, kimi-coding-cn,
  and moonshot so it appears in /model, hermes model, and gateway pickers.
- Add 256K context length fallback entry for k2.6-code-preview.
- Update setup-wizard default model lists to prioritize k2.6-code-preview.
- Fix validate_requested_model() to trust static curated lists when the live
  API responds but omits the model (e.g. Kimi Coding Plan only exposes
  kimi-for-coding), and extend the same trust when the API is unreachable.
- Fix switch_model() to use the Hermes internal provider ID (kimi-coding)
  instead of the models.dev ID (kimi-for-coding) when resolving explicit
  providers, preventing validation mismatches in the model picker.
- Add test coverage for the static-list fallback behavior.

Fixes spurious 'not found' warnings when selecting k2.6-code-preview via
/model or the interactive model picker.
Kimi's k2.6-code-preview on api.kimi.com/coding/v1 rejects any
temperature other than exactly 0.6 with:
  'invalid temperature: only 0.6 is allowed for this model'

- Add hermes_cli.models.kimi_coding_required_temperature() helper
- Pin temperature in Agent._build_api_kwargs() for Kimi Coding routes
- Pin temperature in auxiliary_client._build_call_kwargs()
- Add tests covering positive, negative, and cross-endpoint cases

Also includes unstaged Kimi CLI OAuth header support for coding endpoints.
@nicoechaniz
nicoechaniz force-pushed the feat/kimi-k2.6-code-preview branch from 904492b to 8a093d3 Compare April 20, 2026 05:28
@nicoechaniz

Copy link
Copy Markdown
Contributor Author

Hi @teknium1 — this PR adds first-class support for Kimi k2.6-code-preview across all Kimi providers, plus fixes for spurious validation warnings. It's rebased on latest main and ready for review. Thanks!

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/kimi Kimi / Moonshot type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add k2.6-code-preview support for kimi-coding / kimi-coding-cn / moonshot

2 participants