Repository navigation
feat: add independent dev release channel - #4425
Conversation
Read the canary pointer alongside latest.json when the channel is canary, skip staged rollout for it, keep the update cache per channel, and let `kimi update` switch a canary build back to stable after confirmation. Unset or stable keeps the existing behavior.
Build the newest CI-green main commit as <base>-canary.<UTC stamp>, publish it as a GitHub prerelease with a canary.json record, and optionally publish it to npm under the canary dist-tag. _native-build.yml accepts an explicit commit and version.
|
Codex Review SummaryThis 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1190da65e
ℹ️ 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".
…publish re-runnable Select and record now run from the dispatched revision while the selected commit is only read as build input, so an older green commit still builds. A re-run skips an npm version that already exists and re-uploads assets to an existing release. The non-interactive switch hint keeps the stable channel, and a degraded canary pointer is logged on every refresh path.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f920716d82
ℹ️ 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: 9387719670
ℹ️ 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: 8938f36c89
ℹ️ 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 |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
Port of upstream MoonshotAI/kimi-code 9793044 (MoonshotAI#4425) with the rest of the chain it opened: b9fa2b1 (MoonshotAI#4469), 84a392e (MoonshotAI#4490), ebe14e1 (MoonshotAI#4504) and f695b1f (MoonshotAI#4512). They land together because each one rewrites files the previous introduced, and the dev->canary rename in the middle would otherwise create and delete the same script twice. A release channel is now part of every update decision. `stable` keeps the existing CDN /latest + /latest.json feed; `canary` reads the /channels/canary.json pointer and never falls back to stable, because the two are different release lines. The rename from `dev` to `canary` (MoonshotAI#4490) is part of this landing, so the channel name, the CDN pointer and the canary release script's `-canary.` version suffix all agree. The channel comes from the installed version's prerelease tag, KIMI_CODE_UPDATE_CHANNEL, or the homebrew install source (always stable); an unusable value warns and keeps the installed channel. A pointer for another channel is a switch, not an upgrade, and only the interactive prompt can act on it. The update cache and the staged native record both carry the channel, so a stage downloaded for one line is never adopted by the other, and the hidden downloader takes --channel / --switch-channel alongside --manual. Rollout gating stays off for a switch. The canary release script derives its base version from `changeset status` and refuses a run that would replace a newer published canary. CI gains a scripts-tests job: the root test run covers the workspace packages only, so scripts/test (release trigger, canary release) had no job running it anywhere. Local-form notes: - The fork's update tree was restructured by 8c865f4 (MoonshotAI#2994 staged swap): preflight injects spawn/clock through PreflightDeps, the install lock and auto-install gates live in install-lock.ts / auto-install.ts, and main() moved to cli/main.ts. The ported code keeps that shape instead of upstream's parameter lists. - All new copy goes through t() with en/zh keys (14 new keys) rather than upstream's literals, because check:no-hardcoded-prose is a baseline gate here. Regenerating that baseline after the change lowers sub/upgrade.ts from 8 to 7 literals (the install failure message is localized now) and rewrites the digests of update/cdn.ts and update/native-swap.ts for reworded diagnostics. - The CDN URL helpers live in constant/region-urls.ts here, not constant/app.ts, so kimiCodeCdnDevChannelUrl is added there. - The fork prompts from the cache and revalidates after the user accepts, so the tests pin the prompt at the cached plan and the install at the refreshed one; upstream refreshes before prompting. - ci.yml gets a bun scripts-tests job instead of upstream's node release-workflow-tests, and the canary workflow uses bun plus `bun pm pkg set` / `bun publish` in place of pnpm and node. The canary publish keeps upstream's repository_owner guard, so this fork's CI never publishes; per AGENTS.md the release/publish commands themselves are still not run from this repository. - native-stage's two new guards are localized too, since the baseline is shrink-only and may not absorb new literals. Verified: apps/kimi-code typecheck clean apart from two untouched TUI test files (footer/welcome) that are already red at HEAD; test/cli/update 14 files 215 pass, update-download 20, upgrade 17, native-stage 34/1 skip, scripts suite 228; oxlint --type-aware 0 errors on the touched files; check:no-comments, check:no-hardcoded-prose, check:locale-keys, check:locale-placeholders, check:t-coverage and check:status-surface-i18n green.
Requirement or Bug
将 stable 与 main 的 dev 构建拆成独立发布线,并确保跨渠道更新必须经用户确认。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
发布侧只接受任务开始时 main 的最新提交及其已通过的 CI。dev 版本固定为
0.0.0-dev.<run_number>,不再参考 stable 版本、changeset 或时间戳。客户端将渠道解析、更新决策和安装授权放在同一条数据流中。
native stage 显式保存目标
channel和确认信息。swap 使用同一个decideUpdate()重新判断,未确认的跨渠道 stage 即使版本更高也不会安装。安装来源检测先使用不启动子进程的路径和 SEA 判断,只有出现可安装更新时才补做 npm prefix 检测。CDN 请求的超时现在覆盖 headers 和完整 body,避免响应体卡住时无限等待。npm 发布开关保留但先关闭,先联调 GitHub Release 与仓外 CDN。仓外 CDN 上传和首次安装脚本仍由仓外流程负责。
Behavior Changes and Affected Users
latest与 release 分支流程不变--yes后才安装npm prefix -g旧路径的功能清单及去向:stable
/latest.json与/latest回退、stable rollout、缓存渠道标记、非法值警告、包管理器精确版本安装、native 校验与原子换装均保留。stable/dev 取高、dev 故障回退 stable、单向切换、dev 专用 rollout bypass 和degraded状态删除。私有渠道配置不写入公开文档或 changeset。测试覆盖:
scripts/release-trigger.test.mjs、scripts/dev-release.test.mjs共 13 项,覆盖 main/CI 限制、run number 版本、完整与部分 Release、查询错误及旧 run 防护。fetchChannelFeed()、decideUpdate()和decidePassiveUpdate(),验证 stable hotfix 不影响 dev、dev 故障不读取 stable、Homebrew 使用 stable。pnpm lint0 errors,monorepopnpm typecheck通过,CLIpnpm build通过,三个 workflow YAML 均通过解析,构建产物dist/main.mjs --version正常运行。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.