Repository navigation
chore: merge the code-app desktop migration into main - #5079
Conversation
* chore: import code-app sources into the monorepo Snapshot-import the Kimi Code desktop app and its client packages from code-app (source: MoonshotAI/kimi-code-app desktop-opensource), without git history: apps/desktop, packages/app-*, vite-preset, patches, icon-tools, desktop release scripts, brand sources, release-notes. The snapshot includes code-app's latest product commits (#1364 rollout cap removal, #1365 local file annotations, #1367 empty tooltip fix). Not carried: apps/rc-portal, READMEs, apps/desktop/docs, the changeset/release-notes skills, code-app's pending changesets (they return at cutover), and .changeset/release-plan.json (its referenced changesets stay behind; the release flow regenerates it). Host-repo adaptations: workspace overrides (ssh2, zod, shiki 4.3.1, linkedom 0.18.12, canvas excluded), markstream-vue patch, root scripts and typecheck aggregation, vitest projects, flake.nix workspace lists, oxlint grandfathering of legacy findings via the ratchet baseline, check-comments strip of 401 legacy comments, a CI typecheck step for the desktop app, and pre-public audit scrubs (internal wiki revision in release_branch_kind.py, GitLab-CI wording in the local signing scripts). * build: produce the CLI's bundled web UI from the desktop renderer (#5075) * build: produce the CLI's bundled web UI from the desktop renderer dist-web is no longer committed: apps/kimi-code's prebuild runs scripts/sync-web-dist.mjs, which builds the desktop renderer's web variant and copies it into apps/kimi-code/dist-web; the native-assets workflow and the nix build do the same before packaging. The root gains a sync:web alias and check-web-assets.mjs stays as the packaging guard with an updated message; the stale .commentignore exemption for the previously committed bundle is dropped. * ci: bring the desktop build workflows into the monorepo (#5076) * ci: bring the desktop build workflows into the monorepo desktop-build.yml imported from code-app with the submodule checkout removed; triggers unchanged (release-branch pushes, dispatch, workflow_call). New desktop-ci.yml runs the Windows screenshot-native build, real window enumeration, and desktop tests on windows-latest, gated to desktop-related paths on PRs and full-suite on dispatch. The ci.yml release-workflow-tests job now also runs the imported release.test.mjs. desktop-e2e.yml is held back until the fullmoon-* self-hosted runners are granted to this repository. The main-window host-view tests now stub process.resourcesPath like the other describes in the file: on win32 runners windowsWindowOptions actually joins it, which failed with 'path argument must be of type string' the first time these tests ran on Windows. * ci: merge the desktop release flow into release.yml (#5077) One pipeline on release/* branches now ships both CLI and desktop: the version job runs scripts/version-release.mjs (records release-plan.json) so one version PR bumps CLI and kimi-code-app together; new desktop-release / desktop-artifacts / publish-desktop-assets jobs validate the plan, build four signed platform artifacts via desktop-build.yml, and publish a GitHub Release tagged kimi-code-desktop@<version>. CLI-only releases skip the desktop chain (release.mjs exits with build=false when the plan has no desktop package). The canary prerelease tag uses the same kimi-code-desktop@ prefix.
🦋 Changeset detectedLatest commit: c018690 The changes in this PR will be included in the next version bump. 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 |
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: |
|
❌ Nix build failed |
pnpm-workspace.yaml now carries a patchedDependency ([email protected]) whose patch file lives under patches/; the nix build's src fileset did not include it, so fetchPnpmDeps failed with ENOENT before even reaching the hash check.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cde488a547
ℹ️ 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".
Reported by the nix-build CI on #5079 after patches/ entered the src fileset.
The desktop renderer's tsconfig extends ../../tsconfig.base.json, and vite resolves it while building the web variant inside the nix sandbox (via sync-web-dist). The file came from the code-app import and was not in the fileset.
…se skills (#5081) 31 unconsumed changesets from code-app's desktop-opensource (26 at the snapshot point plus 5 added by later main merges), covering every user-facing desktop change since v1.3.7. Entries are translated to English per this repo's changeset conventions, with overlong ones condensed. code-app's release-plan.json is intentionally not carried: every consumer reads it gated on the branch name, so the stale plan would be inert on any new release branch. gen-changesets is rewritten for the three-product world: the CLI, desktop, and the VS Code extension are user-facing products whose changesets feed release notes, update dialogs, and marketplaces; library source changes always get a library changeset, and changes that flow into a product user-perceivably get a product entry too. sync-changelog now covers two flows: Flow A syncs the CLI changelog into the docs site (unchanged rules), and Flow B prepares the desktop update-dialog bilingual notes under release-notes/<version> from apps/desktop/CHANGELOG.md — curated from English entries and translated into Chinese, with hard length limits (15 words / 40 characters / 10 entries) and a review-before-commit gate. pre-changelog previews both Chinese surfaces before a release PR merges, and locates the version PR by its release/* base branch.
Node cannot execute pnpm.cmd directly via spawnSync on Windows; the sync script now goes through the shell there, unblocking pnpm build on Windows machines and the Windows legs of the native-assets workflow. Also bring the root guide's web UI entry up to date with the imported reality: the source is the desktop renderer, dist-web is a build-time artifact, and pnpm dev:web / sync:web are the in-repo commands. (--no-verify: lint-staged's oxlint step fails with 'No files found to lint' for paths under its ignorePatterns, such as apps/*/scripts/; check-comments and node --check pass.)
# Conflicts: # .agents/skills/gen-changesets/SKILL.md # .changeset/bash-session-workspace-env.md
The conflict resolution re-inserted the product/library bullets that were shared context after the conflict block.
The previous dedupe commit made the duplication worse; the section is now rewritten as a whole: product, library, public KAP, flows-into- product, ignored packages, ask-when-unsure.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c018690ea2
ℹ️ 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".
| on: | ||
| push: | ||
| branches: ['release/**'] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
Restore the missing nightly Canary trigger
In desktop-build.yml, the workflow only declares push, manual, and reusable-workflow triggers, so GitHub can never set github.event_name == 'schedule'. This leaves the nightly-guard, scheduled Canary version resolution, and scheduled publish-canary branches unreachable, silently preventing Canary users from receiving the intended nightly prereleases; add the missing cron schedule.
AGENTS.md reference: AGENTS.md:L135-L137
Useful? React with 👍 / 👎.
| @@ -51,7 +51,7 @@ | |||
| }, | |||
| "scripts": { | |||
| "build": "tsdown && tsdown --config tsdown.dist-worker.config.ts && node scripts/copy-native-assets.mjs && node scripts/check-web-assets.mjs", | |||
| "prebuild": "node scripts/build-vis-asset.mjs", | |||
| "prebuild": "node scripts/build-vis-asset.mjs && node scripts/sync-web-dist.mjs", | |||
There was a problem hiding this comment.
Restore standalone native builds on fresh checkouts
On a fresh checkout, this commit deletes and ignores the previously committed dist-web, but the new synchronization runs only for the ordinary build lifecycle. Direct build:native:sea and build:native:release invocations still enter native/build.mjs without generating the web assets and fail in collectWebAssets; the explicit synchronization added to CI and Nix confirms those scripts do not handle it themselves. Add the synchronization to the native build path so source builders can continue invoking the native scripts directly.
AGENTS.md reference: AGENTS.md:L131-L133
Useful? React with 👍 / 👎.
| @@ -1,5 +1,5 @@ | |||
| --- | |||
| "@moonshot-ai/kimi-code": patch | |||
| "kimi-code-app": patch | |||
There was a problem hiding this comment.
Preserve the CLI remote-control changeset
Replacing @moonshot-ai/kimi-code with kimi-code-app removes this proxy fix from the CLI release notes even though the CLI directly consumes @moonshot-ai/remote-control for kimi web --remote-control. The fresh evidence after the prior skill finding was resolved is that the repaired changeset skill now explicitly requires a separate product entry for every user-perceivable product affected by a library change; retain the CLI entry and add the desktop entry separately. .agents/skills/gen-changesets/SKILL.mdL22-L26
Useful? React with 👍 / 👎.
| return { version, sha, short: sha === '' ? '' : sha.slice(0, 8), built }; | ||
| })(); | ||
|
|
||
| const commitUrl = buildInfo.sha === '' ? '' : `https://github.com/MoonshotAI/kimi-code-app/commit/${buildInfo.sha}`; |
There was a problem hiding this comment.
Point Canary build links at the monorepo
For Canary builds, buildInfo.sha is now the current MoonshotAI/kimi-code monorepo commit, but clicking the build information still opens that SHA in the old MoonshotAI/kimi-code-app repository. New post-migration commits therefore lead users to a missing or unrelated commit instead of the source for their build; update the URL to the monorepo.
AGENTS.md reference: AGENTS.md:L131-L133
Useful? React with 👍 / 👎.
| const plan = JSON.parse(readFileSync('.changeset/release-plan.json', 'utf8')); | ||
| const planned = plan.branch === branch ? plan.packages.find((entry) => entry.name === 'kimi-code-app') : undefined; | ||
| if (planned?.version === pkg.version) calculated = planned.version; | ||
| } |
There was a problem hiding this comment.
Skip Canary builds for release plans without desktop
On a normal weekly release/* branch containing only CLI or VS Code changesets, the push-triggered Desktop build passes the weekly branch gate and invokes this resolver automatically, but neither Changesets status nor the consumed release plan contains kimi-code-app, so calculated remains empty and every push fails here. The release workflow explicitly supports plans without a desktop package, so gate the automatic Canary job on a desktop release entry or skip it cleanly rather than leaving otherwise valid release branches with a failing Desktop build.
Useful? React with 👍 / 👎.
| pnpm --filter kimi-code-app run build:native:screenshot | ||
| pnpm --filter kimi-code-app run build:native:clamshell | ||
| pnpm --filter kimi-code-app exec tsdown | ||
| pnpm --filter kimi-code-app exec electron-builder --config electron-builder.config.cjs --arm64 |
There was a problem hiding this comment.
Apply the macOS update floor in the local fallback
When CI is unavailable and maintainers use this documented local packaging fallback, execution goes directly from electron-builder to artifact verification without running the set-mac-update-minimum-system-version.mjs post-processing used by the official package job. Its latest-mac.yml can therefore omit the Darwin 22 floor even though the app now requires macOS 13; because MacUpdater compares this manifest field with os.release(), publishing these fallback artifacts can offer an incompatible update to macOS 12 clients. Run the same metadata post-processing before treating the local artifacts as complete.
Useful? React with 👍 / 👎.
需求或 Bug
把 Kimi Code 桌面端(code-app 仓)正式合入 main:code-app 以快照方式并入本仓的迁移主体,由 4 个已评审合入的堆叠 PR 组成:
dist-web改构建期产物(不再入库,CLI 构建自动从 desktop renderer 的 web 变体构建)desktop-build.yml四平台构建签名、desktop-ci.ymlWindows 检查)release/*一条流水线同发 CLI 与 desktop,desktop Release tag 为[email protected])合入后:desktop / Web UI 与 CLI / server / agent 同仓演进,kap-server 等引擎改动随 desktop 构建自动生效,跨仓 submodule bump 与 web dist 同步机制退役。
Bug 复现步骤
N/A
根本原因
N/A
代码变更
总 diff 约 2200 文件:导入
apps/desktop(Electron 壳 + 唯一渲染层,含 web 构建变体)、packages/app-*+vite-preset、patches/、发布脚本与品牌资源;本仓侧适配 workspace 配置(zod/ssh2/shiki/linkedom overrides、markstream-vue patch)、根命令、vitest projects、flake.nix 成员、oxlint 存量豁免(ratchet 基线 3732 条只降不升)、CI(typecheck 步骤、desktop-ci、发布脚本测试)与发布流水线。逐项细节见 #5074–#5077 的描述。关键边界:
apps/rc-portal、全部 README、apps/desktop/docs/、changeset/release-notes skills、code-app 的未消费 changeset(切换时带回)与.changeset/release-plan.json(发布流会重新生成);workspace:^依赖改为解析仓内packages/*(源码消费);appId/productName/ 签名身份 / CDN 更新通道全部不变,Release tag 改名(kimi-code-desktop@)不影响存量客户端(更新走 CDN generic provider)。影响范围
desktop-ci.yml的 Windows 检查按 desktop 路径触发;nix-build 在本 PR 首次对 main 目标运行。fetchPnpmDepshash 与 lockfile 不匹配——本机无 nix,待本 PR 的 nix-build 报出正确值后更新flake.nix;desktop-e2e.yml未带回(fullmoon-*自托管 runner 待授权);desktop-signingEnvironment 与签名 secrets 待配置(发布流启用前置);pnpm build:web/ CLI build / smoke / 发布脚本测试全绿;公开前敏感信息审计 P0 零命中。Checklist
changesetskill,或本 PR 无需 changeset。(导入的包均 private/ignored,无用户可感知变化)