Skip to content

Add Kimi Code - #93

Merged
alvinunreal merged 1 commit into
masterfrom
kimi
Jan 28, 2026
Merged

Add Kimi Code#93
alvinunreal merged 1 commit into
masterfrom
kimi

Conversation

@alvinunreal

Copy link
Copy Markdown
Owner

Summary

Changes

@alvinunreal
alvinunreal force-pushed the kimi branch 2 times, most recently from 432bb52 to 8170b25 Compare January 28, 2026 17:06
@greptile-apps

greptile-apps Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This 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:

  • Replaced all cliproxy/gemini-* model references with kimi-for-coding/k2p5 throughout the codebase
  • Updated CLI installation flow: --antigravity flag changed to --kimi
  • Removed addProviderConfig function - assumes Kimi provider config now exists in default OpenCode
  • Deleted entire src/tools/quota/ directory - removed Antigravity quota checking functionality
  • Updated default models in src/config/constants.ts to use Kimi and OpenAI models
  • Improved null safety in src/background/background-manager.ts by removing non-null assertion

Documentation:

  • README updated to recommend kimi-for-coding/k2p5 instead of cliproxy models
  • Installation instructions now guide users to select "Kimi For Coding" provider during opencode auth login

Verification Needed:

  • The model identifier kimi-for-coding/k2p5 should be verified as correct
  • The provider name "Kimi For Coding" in installation instructions should match OpenCode's provider list exactly
  • Default models mix Kimi and OpenAI - ensure fallback logic handles scenarios where only one provider is configured

Confidence Score: 4/5

  • This PR is generally safe to merge with minor verification needed
  • The changes are a straightforward provider replacement with consistent updates across the codebase. The main concerns are: (1) verifying the Kimi model identifier and provider name are correct, (2) ensuring the mixed Kimi/OpenAI default models work when only one provider is configured, and (3) confirming that OpenCode now includes Kimi provider config by default (since addProviderConfig was removed). The background-manager.ts improvement is a positive change.
  • Verify src/cli/providers.ts and src/config/constants.ts have correct model identifiers and provider names that match OpenCode's configuration

Important Files Changed

Filename Overview
src/background/background-manager.ts Removed non-null assertion and added explicit null check for safer queue processing
src/cli/install.ts Installation flow updated to replace Antigravity with Kimi For Coding provider
src/cli/providers.ts Replaced CLIPROXY_PROVIDER_CONFIG with kimi model mappings using kimi-for-coding/k2p5
src/config/constants.ts Default agent models updated to use kimi-for-coding/k2p5 and OpenAI models

Sequence Diagram

sequenceDiagram
    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
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/cli/providers.ts Outdated
options: {
baseURL: 'http://127.0.0.1:8317/v1',
apiKey: 'your-api-key-1',
baseURL: 'https://kimi.moonshot.cn/api/v1',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Comment thread src/cli/providers.ts Outdated
baseURL: 'http://127.0.0.1:8317/v1',
apiKey: 'your-api-key-1',
baseURL: 'https://kimi.moonshot.cn/api/v1',
apiKey: 'your-api-key',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/cli/providers.ts Outdated
models: {
'gemini-3-pro-high': {
name: 'Gemini 3 Pro High',
'kimi-for-coding/k2p5': {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alvinunreal
alvinunreal force-pushed the kimi branch 2 times, most recently from 3659820 to 41ab218 Compare January 28, 2026 17:13
@alvinunreal

Copy link
Copy Markdown
Owner Author

@greptile

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread src/cli/install.ts Outdated
Comment on lines +341 to +343
` ${nextStep++}. Set your Kimi API key as an environment variable:`,
);
console.log(` ${BLUE}$ export KIMI_API_KEY=your_api_key_here${RESET}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alvinunreal
alvinunreal force-pushed the kimi branch 4 times, most recently from 913f9fe to 853efcf Compare January 28, 2026 20:15
@alvinunreal

Copy link
Copy Markdown
Owner Author

@greptile

@alvinunreal alvinunreal changed the title Recommends kimi Add Kimi Code Jan 28, 2026

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/cli/providers.ts
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' },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/config/constants.ts
Comment on lines +24 to 30
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',
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/cli/install.ts
console.log(` ${BLUE}$ opencode auth login${RESET}`);
if (config.hasKimi) {
console.log();
console.log(` Then select ${BOLD}Kimi For Coding${RESET} provider.`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +162 to +163
const task = this.startQueue.shift();
if (!task) break;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alvinunreal
alvinunreal merged commit e8c6b64 into master Jan 28, 2026
1 check passed
nghyane pushed a commit to nghyane/oh-my-opencode-slim that referenced this pull request Jan 31, 2026
@mhenke
mhenke deleted the kimi branch July 10, 2026 16:11
mhenke pushed a commit to mhenke/oh-my-opencode-slim that referenced this pull request Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant