Skip to content

feat(tui): allow shorthand aliases for managed Kimi Code models in /model - #2282

Open
bowenliang123 wants to merge 3 commits into
MoonshotAI:mainfrom
bowenliang123:feat/model-alias-shorthand
Open

feat(tui): allow shorthand aliases for managed Kimi Code models in /model#2282
bowenliang123 wants to merge 3 commits into
MoonshotAI:mainfrom
bowenliang123:feat/model-alias-shorthand

Conversation

@bowenliang123

@bowenliang123 bowenliang123 commented Jul 28, 2026

Copy link
Copy Markdown

Related Issue

No prior issue — this is a small UX convenience improvement.

Problem

In the TUI, /model accepts an alias as its argument, but the model picker shows human-readable names such as K3 under the Kimi Code provider. The actual configured alias is kimi-code/k3, so typing /model k3 (or /model K3) currently fails with Unknown model alias: k3. Users either have to use the interactive picker or remember the full kimi-code/<id> key.

What changed

In handleModelCommand, when the exact alias is not found and the input contains no /, the command now falls back to kimi-code/<input>. This lets users open the model picker for managed Kimi Code models with a short, intuitive name.

  • Exact aliases still take priority, so a user-defined k3 would not be shadowed.
  • Only inputs without / get the fallback.
  • If the resolved alias exists, the model picker opens preselected so the user can still choose the thinking effort before switching.
  • Added a test in kimi-tui-message-flow.test.ts covering the shorthand resolution.
  • A changeset has been generated for @moonshot-ai/kimi-code.

Usage comparison

Before After
/model k3Unknown model alias: k3 /model k3 → opens picker for kimi-code/k3
/model K3Unknown model alias: K3 /model K3Unknown model alias: K3 (still case-sensitive; use the lowercase model id)
/model kimi-code/k3 → opens picker /model kimi-code/k3 → still opens picker
/model kimi-for-coding → Unknown /model kimi-for-coding → opens picker for kimi-code/kimi-for-coding

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above. (No issue; problem explained above.)
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cbb02c1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bowenliang123
bowenliang123 force-pushed the feat/model-alias-shorthand branch from 3efdf36 to cbb02c1 Compare July 28, 2026 02:45
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