Skip to content

Add Kimi Code provider and OpenClaw 2026.4.12 compatibility - #1

Open
EthanCai330 wants to merge 1 commit into
Arain-sh:mainfrom
EthanCai330:codex/kimi-code-openclaw-compat
Open

Add Kimi Code provider and OpenClaw 2026.4.12 compatibility#1
EthanCai330 wants to merge 1 commit into
Arain-sh:mainfrom
EthanCai330:codex/kimi-code-openclaw-compat

Conversation

@EthanCai330

Copy link
Copy Markdown

Summary

This PR adds a separate built-in Kimi Code provider and fixes a startup crash after upgrading openclaw to 2026.4.12.

Changes

  • add a new built-in provider: kimi-code
  • keep existing moonshot behavior unchanged
  • use https://api.kimi.com/coding as the default base URL
  • use anthropic-messages as the protocol for Kimi Code
  • use KIMI_CODE_API_KEY as the env var
  • reuse the existing Moonshot icon
  • update provider registry/types on both frontend and shared backend
  • add unit tests for provider metadata and provider model sync
  • add Electron E2E coverage for Kimi Code in provider lifecycle flow
  • update README.md, README.zh-CN.md, and README.ja-JP.md

OpenClaw compatibility fix

After upgrading openclaw, InvestClaw hit this startup error in the Electron main process:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './plugin-sdk/discord' is not defined by "exports"

This PR fixes that by making the old channel-specific openclaw/plugin-sdk/* imports optional and falling back to compatibility stubs when those exports are no longer available in newer OpenClaw releases.

This keeps the app from crashing on startup with openclaw@2026.4.12

Notes

  • Moonshot (CN) still uses the original China endpoint and existing Kimi web search handling
  • Kimi Code is intentionally separate and does not reuse the Moonshot-specific web search sync logic
  • The channel target picker compatibility fix is designed to prevent startup failure first; newer OpenClaw extension APIs can be integrated later if needed

Validation

Ran successfully:

pnpm typecheck
pnpm test tests/unit/providers.test.ts tests/unit/provider-model-sync.test.ts
pnpm test tests/unit/channel-routes.test.ts
pnpm exec playwright test tests/e2e/provider-lifecycle.spec.ts
pnpm run build:vite

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