Repository navigation
feat: add a Moonshot Kimi chat preset (#240) - #335
Open
Zhangbo-cn wants to merge 1 commit into
Open
Zhangbo-cn wants to merge 1 commit into
Zhangbo-cn wants to merge 1 commit into
Conversation
Zhangbo-cn
requested review from
hsliuustc0106 and
princepride
as code owners
November 15, 2026 06:56
Selecting MoonShot Kimi fills https://api.moonshot.cn/v1 and keeps live model discovery, so the picker lists the models the entered key reaches. The international endpoint stays a custom OpenAI-compatible service.
Zhangbo-cn
force-pushed
the
feat/240-kimi-chat-preset
branch
from
November 15, 2026 07:08
6c4557a to
347ad70
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.
What
Adds the 月之暗面 Kimi / Moonshot Kimi chat preset requested in #240 (mainland chat row).
src/canvas/providerPresets.ts: newkimipreset —kinds: ["agent"],url: https://api.moonshot.cn/v1,openai+api+bearer,logoOrganization: "moonshotai", English nameMoonshot Kimi. Placed afterbailian-beijing, beforezhipu.modelsByKindis deliberately omitted, so Fetch models stays a live/modelscall and the picker lists whatever the entered key can actually reach (same approach asdeepseek). With a mainland key that iskimi-k3andkimi-k3.1-pro.api.moonshot.ai) is a separate row of the [tracking] providers: API integrations #240 matrix and is intentionally not matched — it stays a custom OpenAI-compatible service. The docs paragraph says so.moonshotaialready resolves throughmodelBrands.json→kimi.svg.docs/guides/user-guide.md+user-guide.zh-CN.md: one paragraph per locale (preset, live discovery, international endpoint → custom service).tests/providerPresets.test.ts: 2 tests (preset shape + discovery-stays-on + localized labels + kind filtering; andproviderPresetFor()re-selectingkimifor saved mainland connections while.ai, deeper paths and other kinds fall back tocustom).tests/browser/kimi_real.mjs+manifest.json: an opt-in real-endpoint browser check (helper, needsMOONSHOT_API_KEY, incurs charges, no lane runs it).How tested
Gates on the rebased branch:
Both new tests were mutation-checked: changing the preset URL to
.aifails 2 assertions, addingmodelsByKindfails 1, restoring passes 20/20.Real endpoint against a locally run app (isolated creation server + vite dev server), with a real mainland key:
The script asserts, not just screenshots:
/api/model-configs/discoverreturnskimi-k3, the streamed reply arrives in the UI, the agent-written asset comes back withprovenance.source == "agent_written"andmodelSnapshot.modelId == "kimi-k3", it appears in the asset list, adds a canvas node, and survives a reload. Browser requests tomoonshot.(cn|ai)are asserted never to happen — the key stays server side.Evidence
Notes
kimi-note.txtinside the project. The agent completed it throughopendirector asset write-text, so the whole tool-calling loop works over Kimi.kimi-k3is slow-ish for a full tool round trip (~2 min for 4 calls in my run), which is why the browser check allows long waits; that is the model, not the integration.