Add Kimi Code - #93
Conversation
432bb52 to
8170b25
Compare
Greptile OverviewGreptile SummaryThis PR replaces the Antigravity provider (via cliproxy) with Kimi For Coding as a recommended AI provider for the oh-my-opencode-slim plugin. Major Changes:
Documentation:
Verification Needed:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI as CLI Install
participant Config as Config Manager
participant OpenCode as OpenCode Core
User->>CLI: bunx oh-my-opencode-slim install
CLI->>User: Ask: Do you want to use Kimi For Coding?
User->>CLI: Select yes/no
CLI->>Config: detectCurrentConfig()
Config-->>CLI: Current installation status
CLI->>Config: addPluginToOpenCodeConfig()
Config->>OpenCode: Add oh-my-opencode-slim to plugins
CLI->>Config: disableDefaultAgents()
Config->>OpenCode: Disable default agents
CLI->>Config: writeLiteConfig(hasKimi)
Config->>Config: generateLiteConfig(hasKimi=true)
alt Kimi selected
Config->>Config: Set preset='kimi', models='kimi-for-coding/k2p5'
else OpenAI selected
Config->>Config: Set preset='openai', models='openai/gpt-5.2-codex'
else Neither
Config->>Config: Set preset='zen-free', models='opencode/big-pickle'
end
Config-->>CLI: Configuration written
CLI->>User: Instructions: Run 'opencode auth login'
alt hasKimi
CLI->>User: Then select Kimi For Coding provider
end
CLI->>User: Then run 'opencode'
User->>OpenCode: opencode auth login
OpenCode->>User: Provider selection prompt
User->>OpenCode: Select Kimi For Coding
OpenCode-->>User: Authentication complete
User->>OpenCode: opencode
OpenCode->>Config: Load preset configuration
Config-->>OpenCode: kimi preset with k2p5 models
OpenCode->>OpenCode: Initialize agents with kimi-for-coding/k2p5
|
| options: { | ||
| baseURL: 'http://127.0.0.1:8317/v1', | ||
| apiKey: 'your-api-key-1', | ||
| baseURL: 'https://kimi.moonshot.cn/api/v1', |
There was a problem hiding this comment.
The base URL for Kimi API appears incorrect - https://kimi.moonshot.cn/api/v1 should likely be https://api.moonshot.cn/v1 based on Moonshot AI's API documentation.
| baseURL: 'https://kimi.moonshot.cn/api/v1', | |
| baseURL: 'https://api.moonshot.cn/v1', |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/providers.ts
Line: 13:13
Comment:
The base URL for Kimi API appears incorrect - `https://kimi.moonshot.cn/api/v1` should likely be `https://api.moonshot.cn/v1` based on Moonshot AI's API documentation.
```suggestion
baseURL: 'https://api.moonshot.cn/v1',
```
How can I resolve this? If you propose a fix, please make it concise.| baseURL: 'http://127.0.0.1:8317/v1', | ||
| apiKey: 'your-api-key-1', | ||
| baseURL: 'https://kimi.moonshot.cn/api/v1', | ||
| apiKey: 'your-api-key', |
There was a problem hiding this comment.
Default API key should reference an environment variable pattern like process.env.KIMI_API_KEY or indicate it needs to be replaced, rather than the placeholder string 'your-api-key'
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/providers.ts
Line: 14:14
Comment:
Default API key should reference an environment variable pattern like `process.env.KIMI_API_KEY` or indicate it needs to be replaced, rather than the placeholder string `'your-api-key'`
How can I resolve this? If you propose a fix, please make it concise.| models: { | ||
| 'gemini-3-pro-high': { | ||
| name: 'Gemini 3 Pro High', | ||
| 'kimi-for-coding/k2p5': { |
There was a problem hiding this comment.
The model identifier kimi-for-coding/k2p5 doesn't match standard Moonshot model naming (typically moonshot-v1-*). Verify this is the correct model identifier for the Kimi API.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/providers.ts
Line: 17:17
Comment:
The model identifier `kimi-for-coding/k2p5` doesn't match standard Moonshot model naming (typically `moonshot-v1-*`). Verify this is the correct model identifier for the Kimi API.
How can I resolve this? If you propose a fix, please make it concise.3659820 to
41ab218
Compare
| ` ${nextStep++}. Set your Kimi API key as an environment variable:`, | ||
| ); | ||
| console.log(` ${BLUE}$ export KIMI_API_KEY=your_api_key_here${RESET}`); |
There was a problem hiding this comment.
verify the Kimi API key environment variable name matches what the Kimi provider in OpenCode expects - confirm KIMI_API_KEY is the correct variable name
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/install.ts
Line: 341:343
Comment:
verify the Kimi API key environment variable name matches what the Kimi provider in OpenCode expects - confirm `KIMI_API_KEY` is the correct variable name
How can I resolve this? If you propose a fix, please make it concise.913f9fe to
853efcf
Compare
| designer: { model: 'cliproxy/gemini-3-flash-preview', variant: 'medium' }, | ||
| fixer: { model: 'cliproxy/gemini-3-flash-preview', variant: 'low' }, | ||
| kimi: { | ||
| orchestrator: { model: 'kimi-for-coding/k2p5' }, |
There was a problem hiding this comment.
verify kimi-for-coding/k2p5 is the correct model identifier - this doesn't match standard provider/model naming conventions (typically provider/model-name)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/providers.ts
Line: 8:8
Comment:
verify `kimi-for-coding/k2p5` is the correct model identifier - this doesn't match standard provider/model naming conventions (typically `provider/model-name`)
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| orchestrator: 'kimi-for-coding/k2p5', | ||
| oracle: 'openai/gpt-5.2-codex', | ||
| librarian: 'google/gemini-3-flash', | ||
| explorer: 'google/gemini-3-flash', | ||
| designer: 'google/gemini-3-flash', | ||
| fixer: 'google/gemini-3-flash', | ||
| librarian: 'openai/gpt-5.1-codex-mini', | ||
| explorer: 'openai/gpt-5.1-codex-mini', | ||
| designer: 'kimi-for-coding/k2p5', | ||
| fixer: 'openai/gpt-5.1-codex-mini', | ||
| }; |
There was a problem hiding this comment.
mixing kimi-for-coding/k2p5 and openai/gpt-5.2-codex models assumes both providers are available - check if fallback logic handles missing providers correctly
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config/constants.ts
Line: 24:30
Comment:
mixing `kimi-for-coding/k2p5` and `openai/gpt-5.2-codex` models assumes both providers are available - check if fallback logic handles missing providers correctly
How can I resolve this? If you propose a fix, please make it concise.| console.log(` ${BLUE}$ opencode auth login${RESET}`); | ||
| if (config.hasKimi) { | ||
| console.log(); | ||
| console.log(` Then select ${BOLD}Kimi For Coding${RESET} provider.`); |
There was a problem hiding this comment.
verify the provider name is exactly Kimi For Coding in OpenCode's provider list - if the name doesn't match, users will be confused during authentication
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/install.ts
Line: 344:344
Comment:
verify the provider name is exactly `Kimi For Coding` in OpenCode's provider list - if the name doesn't match, users will be confused during authentication
How can I resolve this? If you propose a fix, please make it concise.| const task = this.startQueue.shift(); | ||
| if (!task) break; |
There was a problem hiding this comment.
improved null safety by removing non-null assertion operator and adding explicit check
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/background/background-manager.ts
Line: 162:163
Comment:
improved null safety by removing non-null assertion operator and adding explicit check
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Summary
Changes