feat(models): integrate Kimi K3 under opencode-go#123
Conversation
Add the Kimi K3 model as a config-driven alias served through the opencode-go provider, mirroring existing Kimi model conventions (256K context, 32K max output, vision, tools, OpenAI Chat Completions endpoint). The `kimi-` prefix handling in the transformer covers K3 automatically (placeholder reasoning, cache_control), so no code path changes were needed. - Register kimi-k3 metadata in model_registry.go - Add kimi-k3 model + fallback chain (k3 -> k2.7-code -> k2.6) to config.example.json and both embedded default templates - Document across MODELS.md, docs/models.md, docs/zh/MODELS.md, CLAUDE.md - Add registry + endpoint-classification test coverage Note: Kimi K3's release/specs are unconfirmed upstream at authoring time; specs mirror kimi-k2.7-code and cost is marked TBD, to be verified against Moonshot AI docs. The synced catalog.json is intentionally left untouched (it is fetched from a remote source). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this incremental commit is actually clean. I need to sit down. I had my flamethrower warmed up and everything. This round properly resolves the previous review's The 📊 Overall: Like a student who actually studied for the makeup exam — the previous mistake was acknowledged and this follow-up commit fixed it properly. Files Reviewed (4 files, incremental)
Previous Review Summaries (3 snapshots, latest commit 031ccf7)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 031ccf7)Verdict: No Issues Found | Recommendation: Merge Oh wait, this incremental diff is actually clean. I need to sit down. I had my flamethrower warmed up and everything. The previous review flagged the triple-copied 📊 Overall: Like a student who actually studied for the makeup exam — the previous mistake was acknowledged and this follow-up commit fixed it properly. The remaining Files Reviewed (3 files, incremental)
Previous review (commit d3d0d7a)Verdict: No Issues Found | Recommendation: Merge Oh wait, this incremental diff is actually clean. I need to sit down. I had my flamethrower warmed up and everything. Overview
Issue Details (click to expand)No new issues found in changed code. 🏆 Best part: The spec fix was thorough — registry metadata, test expectations, and all four doc files (English, Chinese, MODELS.md, CLAUDE.md) are now consistent with the real 1M/131K figures and $3/$15 pricing. That's the kind of complete sync the previous reviewer was begging for. 💀 Worst part: Nothing. I'm actually disappointed. I prepared three different metaphors about triple-copied JSON and I didn't get to use any of them. 📊 Overall: Like a student who actually studied for the makeup exam — the previous mistakes were acknowledged and this follow-up commit fixed them properly. Files Reviewed (6 files)
Previous review (commit ef4ea83)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: Genuinely clean execution — the registry entry, test coverage (endpoint classification and metadata resolution), and the docs/markdown/CLAUDE.md updates are all consistent and complete across every source. The author even caught and fixed their own 💀 Worst part: The one finding is the triple-copied 📊 Overall: Like a tidy desk with three identical sticky notes on it — everything's in the right place, but you only needed one. Files Reviewed (10 files)
Reviewed by hy3:free · Input: 81.9K · Output: 2.6K · Cached: 275.3K Review guidance: REVIEW.md from base branch |
Verified against https://opencode.ai/data/moonshot/kimi-k3. K3 is a released flagship, not a K2.7-code clone: - Context: 1M tokens (was 256K) - Max output: 131K tokens (was 32K) - Modalities: text, image, video - Pricing: $3/1M input, $15/1M output - Released Jul 2026 Update registry metadata, test expectations, and all docs with the real figures and pricing (removes the provisional/TBD placeholders). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses reviewer feedback on the triple-duplicated models/fallbacks blocks (getDefaultConfig, getOpenCodeGoConfig, config.example.json). - Add SYNC comments on both Go template functions pointing at the other two sources, so the next editor knows they are triplets. - Add TestDefaultAndOpenCodeGoConfigsInSync: the two Go templates claim to be identical, so assert their models/fallbacks sections match byte for byte — drift now fails CI instead of shipping silently. - Add TestKimiK3PresentInAllTemplates as a concrete presence check. A full go:embed single-source refactor was considered but left out of scope for this model-addition PR (it restructures all provider templates and the sources are supersets, not interchangeable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Eliminates the triple-duplicated default config that the reviewer flagged. The runtime default now lives in one embedded file, cmd/routatic-proxy/templates/default_config.json: - main.go: getDefaultConfig() returns the //go:embed'd file - init_provider.go: getOpenCodeGoConfig() delegates to getDefaultConfig() (the default provider IS opencode-go, so they were always meant to match) This removes ~561 lines of hand-synced JSON string literals and fixes a latent drift the duplication had already caused: getOpenCodeGoConfig() was silently missing the model_family_overrides block that getDefaultConfig() had. Both now emit the identical, complete config. configs/config.example.json stays separate on purpose — it is a documented superset (cost_routing, aws_bedrock, extra models/overrides) and enables cost routing, so it can't be the runtime default. To keep it honest, a new test asserts every model alias shared between the example and the embedded default is defined identically; this surfaced and fixed stale/missing vision flags on glm-5.2, qwen3.7-plus, qwen3.7-max, and kimi-k2.7-code. Tests: - TestDefaultAndOpenCodeGoConfigsIdentical — the two generators match - TestExampleConfigSharedModelsMatchDefault — example vs default drift guard - TestKimiK3InDefaultConfig — kimi-k3 alias + fallback present Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Integrates the Kimi K3 model as a config-driven alias served through the opencode-go provider — the provider that carries every Kimi model today (k2.5/k2.6/k2.7-code all route through Moonshot upstream via opencode-go).
Specs verified against https://opencode.ai/data/moonshot/kimi-k3:
kimi-prefix handling in the transformer (placeholder reasoning, cache_control) covers K3 automatically — no code-path changes neededkimi-k3 → kimi-k2.7-code → kimi-k2.6Changes
internal/config/model_registry.go— registerkimi-k3metadata (1M / 131K / vision / tools) (+ test)internal/client/opencode_test.go— endpoint-classification test caseconfigs/config.example.json,cmd/routatic-proxy/main.go,cmd/routatic-proxy/init_provider.go— model entry + fallback chain across all three config sources (consistentvision: true)MODELS.md,docs/models.md,docs/zh/MODELS.md,CLAUDE.md— docs with real specs + pricingcatalog.jsonintentionally left untouched (fetched from remote source; will pick up K3's full catalog entry on next sync)Testing
go build ./...✅go vet ./...✅go test ./...✅ (full suite)Notes
max_tokensin the config aliases stays at a conservative per-request default (32K); the registry carries the true 131K cap for capacity filtering.long_contextscenario, but routing logic was left unchanged (out of scope).🤖 Generated with Claude Code