feat(models): add Kimi (Moonshot) provider with K2.6 and K2.7#27
Conversation
Register Kimi as an OpenAI-compatible provider targeting the Moonshot coding endpoint, with Kimi K2.6 and K2.7 Code as vision-capable models. - New LanguageModel.Kimi enum (k26=k2p6, k27=k2p7); both support vision (text/image/video input) and tools; context 262144 - New Provider.kimi: id "kimi", MOONSHOT_API_KEY env (KIMI_API_KEY alias), default baseURL https://api.kimi.com/coding/v1 - ProviderFactory routes .kimi through OpenAICompatibleProvider, now extended with an optional capabilities parameter - Parse qualified (kimi|moonshot/...) and loose (kimi-k2.6, k2p7, ...) ids - Wire all exhaustive LanguageModel switches (==, hash, description, capabilities key, pricing) and the AI-CLI example - Tests: ModelParsingTests (parse + vision + context), CoverageTests list
|
Codex review: needs real behavior proof before merge. Reviewed June 27, 2026, 6:07 PM ET / 22:07 UTC. Summary Reproducibility: not applicable. as a user bug reproduction; this PR adds a new provider feature. The PR blockers are source-reproducible from the unchanged ModelSelector fallback and ProviderTests provider-list contract, plus missing runtime proof in the PR body/comments. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Complete Kimi as a full first-class provider by wiring selection/help/default-provider/test surfaces, adding mocked provider-path coverage and redacted live proof, then land Tachikoma before dependent Peekaboo submodule changes. Do we have a high-confidence way to reproduce the issue? Not applicable as a user bug reproduction; this PR adds a new provider feature. The PR blockers are source-reproducible from the unchanged ModelSelector fallback and ProviderTests provider-list contract, plus missing runtime proof in the PR body/comments. Is this the best way to solve the issue? No, not yet. The ProviderFactory shape follows nearby patterns, but the branch needs selection/parser/test coverage, mocked request-path coverage, real behavior proof, and maintainer acceptance of the new provider contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae08789eea52. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
Adds Kimi (Moonshot AI) as a first-class, OpenAI-compatible provider with two vision-capable models: Kimi K2.6 (
k2p6) and Kimi K2.7 Code (k2p7). Targets the Moonshot coding endpoint (https://api.kimi.com/coding/v1).Both models are multimodal (text/image/video input), so consumers like Peekaboo can use them for screenshot/image analysis.
Changes
Models/Model.swift: newLanguageModel.Kimienum (k26,k27); vision + tools enabled; context 262144. Newcase kimi(Kimi)onLanguageModel; parse qualified (kimi/moonshot) and loose ids (kimi-k2.6,k2p7, ...); updated==,hash(into:), description/modelId/provider/vision/tools/context switches.Core/Provider.swift:Provider.kimi(idkimi,MOONSHOT_API_KEYenv +KIMI_API_KEY/MOONSHOT_KEYaliases, baseURLhttps://api.kimi.com/coding/v1, standardProviders,from(identifier:)).Providers/ProviderFactory.swift:.kimi→OpenAICompatibleProvider.Providers/Compatible/OpenAICompatibleProvider.swift: optionalcapabilities:parameter (mirrorsAnthropicCompatibleProvider).Core/ModelCapabilities.swift,Utilities/UsageTracking.swift,Examples/AI-CLI: exhaustive-switch wiring + example.ModelParsingTests(parse + vision + context),LanguageModelCoverageTestslist.Test commands executed
31 tests pass (incl. new
parse Kimi (Moonshot) model ids).Notes
k2p6,k2p7) and the coding endpoint are taken from the OpenCode built-inkimi-for-codingprovider definition; both models advertisemodalities.input = [text, image, video], hencesupportsVision = true.UsageTrackingis a placeholder estimate pending Moonshot's published rates.