[codex] Add Moonshot Kimi backend provider#639
Merged
Conversation
25ee84a to
ce47375
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a direct Moonshot chat completions provider implementation for Kimi K2.6, including request normalization, streaming/non-streaming billing, provider error pass-through, usage parsing, and
MOONSHOT_API_KEYenv wiring.This PR intentionally preserves current production routing for
moonshotai/kimi-k2.6: that model still routes through OpenCode Zen. The new Moonshot provider path is wired into the routing code, but OpenCode Zen has precedence for the existing Kimi alias so production behavior does not change yet.Validation
CI=true bun test web/src/app/api/v1/chat/completions/__tests__/completions.test.ts web/src/llm-api/__tests__/kimi-tool-compat.test.tsCI=true bun test common/src/__tests__/env-ci.test.ts common/src/__tests__/env-process.test.tsbun run --cwd web typecheckbun run --cwd packages/internal typecheckgit diff --checkLive checks
MOONSHOT_API_KEYreturned a realkimi-k2.6response.base2-free-kimirun end-to-end through the backend. The BuffBench task scored 6.8/10; its task-level failures were from the agent's code attempt, not provider routing.