Repository navigation
feat: add minimum version upgrade prompts - #4756
Conversation
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
🟡 Changes recommended
Active issues remain in forced-update channel resolution and retry-state handling, and missing main-handler coverage leaves key escape-hatch branches unverified.
3 open issues
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
Adds a cloud-controlled minimum-version policy for interactive CLI launches. Users below the configured minimum can install a qualifying release, retry when necessary, or skip the requirement for the current launch after a countdown.
Changes:
- Adds shared
client_upgrade_policyparsing and semver comparison for independent CLI and Desktop minimums. - Registers the policy with kap-server and adds product/server coverage.
- Implements forced upgrade preflight, target validation, retries, telemetry, installation, and timed per-launch skipping.
- Adds the interactive prompt, startup integration, dependency metadata, and focused tests.
| File | Description | Final review notes |
|---|---|---|
pnpm-lock.yaml |
Locks the new semver dependencies. | No final review comment. |
packages/product/test/client-configs.test.ts |
Tests policy parsing and version comparisons. | No final review comment. |
packages/product/src/client-configs/node/upgrade-policy.ts |
Defines the shared upgrade-policy schema and semver checks. | No final review comment. |
packages/product/src/client-configs/node/index.ts |
Exports the upgrade-policy module. | No final review comment. |
packages/product/package.json |
Adds semver runtime and type dependencies. | No final review comment. |
packages/kap-server/test/clientConfigs.test.ts |
Tests policy registration and response normalization. | No final review comment. |
packages/kap-server/src/services/clientConfigs.ts |
Registers client_upgrade_policy for server consumers. |
No final review comment. |
apps/kimi-code/test/cli/update/prompt.test.ts |
Tests forced-prompt countdown and keyboard behavior. | No final review comment. |
apps/kimi-code/test/cli/update/preflight.test.ts |
Tests forced preflight decisions, retries, skips, and target validation. | No final review comment. |
apps/kimi-code/test/cli/main.test.ts |
Updates main-command mocks for forced preflight integration. | Nit, 2 votes: Add coverage for skip-passive suppressing passive updates and exit stopping the shell. |
apps/kimi-code/src/cli/update/forced.ts |
Implements policy checks, feed refresh, validation, installation, retries, and telemetry. | Moderate [P1], 2 votes: Resolve the forced check through the same source-aware channel resolver as the passive updater. Nit [P2], 2 votes: Clear targetVersion before each new feed check to prevent stale target data in the prompt and telemetry. |
apps/kimi-code/src/cli/update/forced-prompt.ts |
Implements the interactive forced-upgrade selector and countdown. | No final review comment. |
apps/kimi-code/src/cli/main.ts |
Runs forced upgrade handling before passive update checks for interactive startup. | Nit, 2 votes: Add main-handler coverage for the new forced-result branches. |
Review effort: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b83084204
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76b8de9301
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d8ec55190
ℹ️ 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".
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Ingest the 15 upstream commits landed after the 2.5.3 release sync and cluster the open backlog into themed batches. Three rows stay unassigned pending a scope decision: prediction (MoonshotAI#4754, six packages), upgrade prompts (MoonshotAI#4756), and the desktop-titled retry fix (MoonshotAI#4831) whose content lives in agent-core-v2/kap-server.


Requirement or Bug
Interactive CLI users whose installed version falls below an independently configured minimum need a clear upgrade path instead of relying on passive update discovery and rollout timing. This PR adds a named
client_upgrade_policyconfiguration with separate CLI and Desktop minimums, plus an interactive upgrade prompt that can always be skipped for the current launch after a 10-second countdown.No tracking issue; this is an internal product feature request.
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
The change separates the minimum allowed version (
client_configs) from the available update version (the existing CDN feed). The new forced path runs before passive updates only for interactive TUI launches, uses the current release channel without rollout gating, and leaves print mode, CI, unsupported source checkouts, and all other subcommands on their existing paths.flowchart TD A[client_upgrade_policy] --> B[Shared schema and semver check] B --> C{Interactive and below minimum?} C -- No --> D[Existing passive update flow] C -- Unsupported source --> D C -- Yes --> E[Refresh current-channel feed] E --> F{Target meets minimum?} F -- No --> G[Error, retry, or timed skip] F -- Yes --> H[Install or timed skip]client_configsJSONlatest.jsonkimi -pand CI keep their existing behavior and never wait on interactive UI.Reading order:
packages/product/src/client-configs/node/upgrade-policy.ts— shared wire schema, independent field parsing, and semver boundary.apps/kimi-code/src/cli/update/forced.ts— policy check, target validation, retries, skip behavior, and telemetry.apps/kimi-code/src/cli/update/forced-prompt.ts— terminal choices and countdown behavior.apps/kimi-code/src/cli/main.ts— the narrow interactive-startup integration point.packages/kap-server/src/services/clientConfigs.ts— registration of the same named config for daemon consumers.The remaining changes are focused tests and dependency metadata for the shared semver parser.
Screenshots / Recordings
A forced prompt when a satisfying target exists:
When the channel has not published a satisfying target, the primary action becomes
Retry update; the same countdown gatesSkip for this run.Behavior Changes and Affected Users
Skip for this runafter 10 seconds; next launch prompts againkimi -pand CIKIMI_CODE_NO_AUTO_UPDATEkimi upgradeCoverage:
Verification
git diff --checkpassed.cliMinVersion=0.6.0anddesktopMinVersion=1.2.0.Changeset: intentionally omitted per repository owner request.
gen-docswas run, but its requireddocs/scripts/sync-changelog.mjswas absent, so no generated changelog or manual replacement was added.Checklist
gen-docs; its changelog sync prerequisite was unavailable, so no generated docs were changed.