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.
feat(shell): guide users to upgrade to the new Kimi Code #2432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat(shell): guide users to upgrade to the new Kimi Code #2432
Changes from 2 commits
d9a4b280aa8b6ac274678304343526d34deFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
sys.platform == "win32",/upgradepasses this bare PowerShell pipeline to_run_shell_command, which runs it throughasyncio.create_subprocess_shellusing the platform default shell (normallycmd.exe), whereirmandiexare not commands. Windows users who accept the prompt therefore get a shell failure instead of an install; return a command that explicitly launches PowerShell or teach the caller to use PowerShell for this platform.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡
exit_nudge_text()hardcodes the bash install command, showing wrong command on Windowsexit_nudge_text()at line 77 hardcodes_INSTALL_SH(thecurl ... | bashcommand) in the exit nudge shown on graceful exit. On Windows, users will see a bash command they cannot use. The function should useinstall_command(sys.platform)to select the platform-appropriate command, as the/upgradecommand correctly does atsrc/kimi_cli/ui/shell/slash.py:730.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the CLI exits on Windows and Kimi Code is not installed,
print_migration_goodbye()prints thisexit_nudge_text(), but the text hard-codes the Unixcurl ... | bashinstaller instead of using the platform-specific command. That means Windows users get an exit prompt with a command that depends onbashand bypasses the PowerShell installer path thatinstall_command()otherwise defines, so the migration guidance is not actionable in that environment.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the prompt is toggled to shell mode with Ctrl-X,
_run_shell_commandonly dispatches slash commands found inshell_mode_registry; because/upgradeis registered only in the agent-mode registry here, a user following the new welcome/exit guidance while in shell mode gets the "not available in shell mode" warning instead of the installer. Since this command does not require agent context, it should be registered in shell mode as well.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the installer exits non-zero (for example due to no network, a 404 from the install URL, or a shell error),
_run_shell_commandonly waits for the subprocess and returnsNone, so this path still prints “The new Kimi Code is installed ✓” even though nothing was installed. The upgrade flow should observe the subprocess exit status or verify~/.kimi-codebefore showing the success/migration message.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a successful installer run, this message says config and sessions were migrated, but the Kimi Code migration flow does not run during installation: the first
kimilaunch prompts the user, or they can runkimi migratemanually (per the migration docs). In the normal/upgradepath where the installer succeeds and the user has not yet launched the new CLI, this falsely tells them their data is already carried over; change this to say migration will be offered on first launch or to runkimi migrate.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴
/upgradeunconditionally prints success message even when installation failsAfter
await app._run_shell_command(cmd)at line 750, the success message ("The new Kimi Code is installed ✓") is printed unconditionally at lines 751-756._run_shell_command(src/kimi_cli/ui/shell/__init__.py:716) returnsNone, swallows exceptions internally, and does not check the subprocess exit code. If the install script fails (non-zero exit), the subprocess can't be created, or the network is down, the user still sees the success message claiming installation succeeded and config was migrated.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.