refactor: unify managed model display as "Kimi for Code"#1860
refactor: unify managed model display as "Kimi for Code"#1860
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the CLI’s managed-model messaging to remove hardcoded kimi-k2.5 references and consistently present the managed experience under the “Kimi for Code” brand, reducing future churn when K2 model versions change.
Changes:
- Update managed alias display (
kimi-for-coding/kimi-code) to render as “Kimi for Code”. - Relax the welcome-screen
/logintip gating to allow managed aliases and anykimi-k2*model without showing the prompt. - Broaden the
ModelInfo.capabilitiesfallback to apply to allkimi-k2*models (instead of onlykimi-k2.5).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/kimi_cli/llm.py | Updates model display naming for managed aliases to “Kimi for Code”. |
| src/kimi_cli/auth/platforms.py | Expands K2 capability fallback from a single version to a kimi-k2* prefix match. |
| src/kimi_cli/app.py | Updates welcome-screen /login tip logic and wording to be brand-based and version-agnostic. |
| docs/zh/release-notes/changelog.md | Adds an Unreleased release-note entry describing the change (ZH). |
| docs/en/release-notes/changelog.md | Adds an Unreleased release-note entry describing the change (EN). |
| CHANGELOG.md | Adds an Unreleased release-note entry describing the change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def model_display_name(model_name: str | None) -> str: | ||
| if not model_name: | ||
| return "" | ||
| if model_name in ("kimi-for-coding", "kimi-code"): | ||
| return f"{model_name} (powered by kimi-k2.5)" | ||
| return "Kimi for Code" | ||
| return model_name |
There was a problem hiding this comment.
The managed aliases ("kimi-for-coding"/"kimi-code") and the display brand string ("Kimi for Code") are now duplicated across multiple places (here, derive_model_capabilities(), and app.run_shell). Consider centralizing them into a shared constant/helper (e.g., is_kimi_for_code_model(name) + KIMI_FOR_CODE_DISPLAY_NAME) to avoid future drift when aliases/branding change.
| model_name = self._soul.model_name | ||
| if model_name not in ( | ||
| "kimi-for-coding", | ||
| "kimi-code", | ||
| "kimi-k2.5", | ||
| "kimi-k2-5", | ||
| ): | ||
| ) and not model_name.startswith("kimi-k2"): | ||
| welcome_info.append( |
There was a problem hiding this comment.
model_name.startswith("kimi-k2") is case-sensitive; if the model name originates from user input/env vars with different casing, the /login tip may show unexpectedly. Consider normalizing once (e.g., model_name_lower = model_name.lower()) before the alias/prefix checks for consistency with ModelInfo.capabilities (which uses self.id.lower()).
Description
The CLI hardcoded
kimi-k2.5in three places that would need updating on every model version bump:model_display_nameappended(powered by kimi-k2.5)to the managed model aliases (kimi-for-coding/kimi-code) in the welcome screen./logintip listedkimi-k2.5/kimi-k2-5in its whitelist and advertised "our latest kimi-k2.5 model".ModelInfo.capabilitiesapplied a capability fallback (thinking + multimodal) only when the model id literally containedkimi-k2.5.This refactor drops the version-specific references in favor of the umbrella "Kimi for Code" brand, so future k2.x bumps no longer require code changes:
kimi-for-coding/kimi-codenow render asKimi for Code— the internal version is no longer exposed in the welcome screen./logintip: whitelist now matches the two managed aliases plus anykimi-k2.*model (covers direct open-platform users on k2.5, future k2.6, etc.), and the text is simplified tosend /login to use Kimi for Code.ModelInfo.capabilitiesmatches thekimi-k2.prefix, giving the same transitional coverage for k2.x on open platforms. This workaround stays in place until the managed/modelsAPI properly returns capability flags.