Skip to content

fix(update): refresh target before foreground prompts - #405

Merged
liruifengv merged 2 commits into
mainfrom
liruifeng/fix-update-prompt-stale-latest
Jun 4, 2026
Merged

fix(update): refresh target before foreground prompts#405
liruifengv merged 2 commits into
mainfrom
liruifeng/fix-update-prompt-stale-latest

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue; this fixes foreground update prompts showing a stale cached target version.

Problem

Startup preflight could read an older cached latest version, then refresh the cache in the background. When automatic background installs were not used and a foreground prompt or manual command was shown, the UI could display the cached version even though a newer version was available from the fresh check.

What changed

  • Refresh the user-visible update target before rendering foreground update prompts or manual update commands.
  • Keep automatic background install startup behavior non-blocking.
  • Add a regression test for stale cached targets so the prompt, install command, actual install, and success message all use the refreshed version.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem 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.

Validation

  • pnpm exec vitest run apps/kimi-code/test/cli/update/preflight.test.ts
  • pnpm --filter @moonshot-ai/kimi-code run typecheck
  • pnpm exec oxlint --type-aware apps/kimi-code/src/cli/update/preflight.ts apps/kimi-code/test/cli/update/preflight.test.ts
  • git diff --check

@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 54f18a8

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 4, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@54f18a8
npx https://pkg.pr.new/@moonshot-ai/kimi-code@54f18a8

commit: 54f18a8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7196f96d6f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/cli/update/preflight.ts
@liruifengv
liruifengv force-pushed the liruifeng/fix-update-prompt-stale-latest branch from 7196f96 to b0c5067 Compare June 4, 2026 04:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54f18a8b65

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/cli/update/preflight.ts
@liruifengv
liruifengv merged commit 07e2e0f into main Jun 4, 2026
8 checks passed
@liruifengv
liruifengv deleted the liruifeng/fix-update-prompt-stale-latest branch June 4, 2026 05:10
@github-actions github-actions Bot mentioned this pull request Jun 4, 2026
sunjie21 pushed a commit to sunjie21/kimi-code that referenced this pull request Jun 4, 2026
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