Skip to content

refactor: unify managed model display as "Kimi for Code"#1860

Merged
RealKai42 merged 2 commits intomainfrom
kaiyi/fix-0413
Apr 13, 2026
Merged

refactor: unify managed model display as "Kimi for Code"#1860
RealKai42 merged 2 commits intomainfrom
kaiyi/fix-0413

Conversation

@RealKai42
Copy link
Copy Markdown
Collaborator

@RealKai42 RealKai42 commented Apr 13, 2026

Description

The CLI hardcoded kimi-k2.5 in three places that would need updating on every model version bump:

  1. model_display_name appended (powered by kimi-k2.5) to the managed model aliases (kimi-for-coding / kimi-code) in the welcome screen.
  2. The welcome-screen /login tip listed kimi-k2.5 / kimi-k2-5 in its whitelist and advertised "our latest kimi-k2.5 model".
  3. ModelInfo.capabilities applied a capability fallback (thinking + multimodal) only when the model id literally contained kimi-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:

  • Display: kimi-for-coding / kimi-code now render as Kimi for Code — the internal version is no longer exposed in the welcome screen.
  • /login tip: whitelist now matches the two managed aliases plus any kimi-k2.* model (covers direct open-platform users on k2.5, future k2.6, etc.), and the text is simplified to send /login to use Kimi for Code.
  • Capability fallback: ModelInfo.capabilities matches the kimi-k2. prefix, giving the same transitional coverage for k2.x on open platforms. This workaround stays in place until the managed /models API properly returns capability flags.

Open with Devin

Copilot AI review requested due to automatic review settings April 13, 2026 15:14
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 /login tip gating to allow managed aliases and any kimi-k2* model without showing the prompt.
  • Broaden the ModelInfo.capabilities fallback to apply to all kimi-k2* models (instead of only kimi-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.

Comment on lines 49 to 54
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
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +514 to 519
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(
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

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()).

Copilot uses AI. Check for mistakes.
@RealKai42 RealKai42 merged commit 44440c8 into main Apr 13, 2026
24 checks passed
@RealKai42 RealKai42 deleted the kaiyi/fix-0413 branch April 13, 2026 15:20
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.

2 participants