feat: Add support for Kimi For Coding model#1514
Closed
clawaizhang wants to merge 0 commit intosipeed:mainfrom
Closed
feat: Add support for Kimi For Coding model#1514clawaizhang wants to merge 0 commit intosipeed:mainfrom
clawaizhang wants to merge 0 commit intosipeed:mainfrom
Conversation
Author
👤 Reviewers/cc @yinwm 麻烦帮忙 review 一下这个 PR,是关于添加 Kimi For Coding 支持的 Provider 修改。谢谢! |
7266d91 to
c022f8b
Compare
6b59b81 to
c022f8b
Compare
yinwm
requested changes
Mar 14, 2026
Collaborator
yinwm
left a comment
There was a problem hiding this comment.
Code Review Summary
Thanks for the contribution!
Issues
- Major: Protocol routing issue -
kimi-for-codingwithout prefix falls into default case. Fix: Add special handling inopenaicase before merging. - Medium: Hardcoded version
2.1.39- Extract as constant - Medium: Imprecise string matching - Use more precise matching
- Medium: Missing unit tests
Suggestion
Create kimi.go in anthropic_messages directory to centralize Kimi logic.
yinwm
requested changes
Mar 14, 2026
Collaborator
yinwm
left a comment
There was a problem hiding this comment.
Code Review Summary
Thanks for the contribution!
Issues
| Severity | Issue | Suggestion |
|---|---|---|
| 🔴 Major | Protocol routing: kimi-for-coding without prefix falls into default case |
Add special handling at the beginning of openai case |
| 🟡 Medium | Hardcoded version 2.1.39 will become outdated |
Extract as a constant |
| 🟡 Medium | Contains may match unintended URLs |
Use more precise matching |
| 🟡 Medium | Missing unit tests | Add test coverage |
Suggestion
Create kimi.go in anthropic_messages directory:
pkg/providers/anthropic_messages/
├── provider.go
├── kimi.go # Kimi-specific logic
└── provider_test.go
This keeps Kimi logic centralized, easier to maintain and test.
Author
|
@yinwm thanks for your comments, I add kimi providers to keeps Kimi logic centralized, easier to maintain and test. |
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.
📝 Description
Add Claude Code User-Agent headers to bypass Coding Agent restriction for Kimi For Coding model. When using
kimi-for-codingmodel or accessingkimi.com/codingendpoint, the provider now sendsUser-Agent: claude-cli/2.1.39andx-app: cliheaders to identify as a Coding Agent.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
Fixes #1293
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Tested with configuration:
{ "model_name": "kimi-coding", "model": "kimi-for-coding", "api_base": "https://api.kimi.com/coding/v1", "api_key": "sk-xxx" } ```json ☑️ Checklist My code/docs follow the style of this project. I have performed a self-review of my own changes. I have updated the documentation accordingly.