Repository navigation
Conversation
…s default config
The TUI driver made its pseudo-terminal with the system script command,
which Windows lacks and which cannot change the terminal size. Start the
launcher in node-pty instead (already a Desktop dependency); the terminal
is still xterm.js. node-pty is loaded when a TUI case starts, so a missing
native build only fails the TUI.
Add a resize('narrow' | 'normal') user action on the TUI (120x40 and
60x40, delivered as SIGWINCH) and on Web (1440x900 and 390x844). The TUI
evidence is a full redraw after the resize plus the input box or panel
drawn at the new width; the Web evidence is the visible input area laid
out inside the new viewport and stable across two reads. A restart keeps
the size. A new scenario narrows the window while a reply streams.
Run the product with the user's default config: testkit now exports the
switches it turns off only to speed up unit tests (session index read
model, search worker) as UNIT_TEST_SWITCHES, and the E2E drivers unset
them.
Split the Desktop and Web CI jobs into two shards each and run Desktop
with two workers (one when headed); the run summary names the shard.
…d update the import check test Electron downloads its binary the first time it is started. With two Desktop workers both cases downloaded and spawned it at once and failed with spawn ETXTBSY, so the Desktop job now fetches it in a step before the cases run. The boundary check's own test still expected the TUI driver to import node:child_process; it now checks node-pty instead.
…Windows jobs - TUI: on Windows the CLI runs directly in ConPTY through node-pty and the exit code comes from the pseudo-terminal; Linux and macOS keep the /bin/sh launcher that prints stty -a after the CLI exits. - Web: kimi web now runs in a pseudo-terminal on every platform, the way a user starts it, and the driver stops it by pressing Ctrl+C there instead of sending SIGINT to its process group. The address is read from the terminal output with control sequences removed. - ACP: terminal commands are detached only off Windows and are killed with killProcessTree (taskkill /T on Windows). - Desktop: the own-process check looks at the main process on Windows, where process groups do not exist. - Shared: file paths in approvals also match the platform path join, the run summary normalises backslashes, and the case time limit follows the testkit platform factor. - Verbs can be unavailable on a platform (unavailableOn); scenarios that use one declare exceptPlatforms. expectTerminalRestored is unavailable on Windows for now. - e2e.yml gains a Windows job per surface that runs on manual dispatch only.
…Windows The TUI on Windows shows the real path of a file with forward slashes, while the test workspace path can be a short 8.3 alias with backslashes. Compare against the workspace and its real path with slashes normalised. ConPTY repaints the screen itself after a resize and does not pass the CLI's clear-screen sequence through, so on Windows resize() waits for new output plus the input box drawn at the new width. Failure diagnostics of the TUI now include the tail of the raw terminal output.
…e Desktop home a Downloads folder
ConPTY draws the kimi web banner with cursor moves instead of newlines,
so the address line never matched after stripping control sequences.
Render the server's terminal in xterm.js and read its rows, the way a
user reads the screen.
Desktop creates its main window with app.getPath('downloads'), which
fails on Windows when the isolated home has no Downloads folder. Create
it in the test home before launching, as every real profile has one.
- ACP: once a command has exited, kill only its process group on POSIX and nothing on Windows, where its process id may already belong to another process. - kimi web in a pseudo-terminal: fail at once when the server exits before printing its address, check that the entry exists, clean up a process group left behind, and describe the rendered screen. - exceptPlatforms must be backed by an action that is unavailable on the excluded platform; the closing checks report one that is not. - The guide says what the weaker resize evidence on Windows cannot prove.
On Windows the evidence of a redraw is any new output, so resize() could return while the CLI was still drawing and a restart right after it saw a busy screen. Wait until the input box or panel has the new width and two reads of the screen agree.
|
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. |
…pending approval After the user answers an approval on Desktop or Web, the card stays on screen with disabled buttons until the product has handled the answer. The renderer treated it as a pending approval, so waitIdle() right after rejectWithFeedback() failed on a slow Windows runner. An approval is pending only while its buttons are visible and enabled.
commit: |
…r them isEnabled() waits for the element, so when the approval card folded away between isVisible() and isEnabled() the check hung for the full time limit while stopping a turn that waits for approval. Look up enabled buttons by role instead; isVisible() does not wait.
Requirement or Bug
新 E2E 只在 Linux 上跑,而 CLI 和 Desktop 都发布 Windows 版本,主 CI 的 Windows 测试从 6 月起一直关着。这个 PR 让新 E2E 的四个面都能在 Windows 上跑,并在
e2e.yml里加上手动触发的 Windows 作业。先只手动触发,等四个面在 Windows 上都稳定通过,再放到 PR 上。基于 MoonshotAI/kimi-code#5380(这个 PR 的 base 是它的分支)。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
核心思路:用户在 Windows 上怎么用,驱动就怎么用。TUI 和
kimi web都跑在 ConPTY 的伪终端里,kimi web在三个平台上都改成在终端里按 Ctrl+C 结束;进程的启动和停止按平台区分;Windows 上暂时做不到的检查在动作表里声明,并写明理由。/bin/sh和sttyexpectTerminalRestored在 Windows 上不适用(unavailableOn)resize的证据在 Windows 上改为「改尺寸之后有新的输出,并且输入框按新宽度画好」process.kill(-pid, 'SIGINT')在 Windows 上等于强杀,验证不了正常退出kimi web跑在伪终端里(surfaces/terminal-process.ts),驱动在终端里按 Ctrl+C;三个平台都这样,比原来发信号更像用户detached;用killProcessTree停(Windows 上是taskkill /T)Downloads,产品创建主窗口时取下载目录就失败Downloads(真实用户都有);产品这一侧的问题另行记录C:/…/workspace/docs/b.txt,测试的工作区是短路径加反斜杠namesFile用工作区和它的真实路径、统一成/再比较scenarios/前缀分类、用例限时 120 秒/;限时跟着 testkit 的平台系数关键决策:
unavailableOn+ 场景exceptPlatforms,写明理由.skipkimi web的结束方式阅读指南:
tests/e2e/surfaces/terminal-process.ts:在伪终端里跑kimi web、按 Ctrl+C、从渲染后的屏幕读行。tests/e2e/surfaces/tui.ts的startTui、exitCode、resize:Windows 上不用启动脚本。tests/e2e/support/verbs.ts的unavailableOn、namesFile,support/scenario.ts的exceptPlatforms。.github/workflows/e2e.yml末尾的windows作业。acp.ts、desktop.ts、run-summary.ts、playwright.config.ts。Behavior Changes and Affected Users
产品代码没有改动,受影响的是写和跑新 E2E 的人,以及 CI。
expectTerminalRestored和用到它的场景在 Windows 上显示为不适用kimi web的启动和结束node-pty(见 #5380)unavailableOn、exceptPlatforms)e2e.ymlWindows <面> (manual)作业,只在手动触发时跑验证结论:四个面的全套在本机 macOS 上照常通过;Windows 上试跑了三次,ACP、Web 都全过过一次,TUI 从 8 条红修到 1 条再修好,Desktop 在第三次试跑里验证;剩下的 Windows 红是产品问题,见下。
验证细节
本机 macOS arm64,构建产物(
TESTKIT_CLI_BUILD=dist):破坏性检查:
TerminalProcess.interrupt()不写 Ctrl+CexceptPlatformsWindows(GitHub
windows-latest,手动触发):C:/…,测试的工作区是短路径;ConPTY 不转发清屏序列。Web 等不到地址:ConPTY 用光标定位输出横幅。Desktop 主窗口打不开:隔离目录里没有Downloadskimi acp退出时 libuv 断言失败(Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76),是产品问题,第 1 次没出现还没解决的 Windows 问题(产品一侧,不在这个 PR 里修):
kimi acp退出时偶发崩溃(上面的 libuv 断言);app.getPath('downloads')(apps/desktop/src/main/window/main-window.ts:605),取不到就建不出主窗口,错误只记成一条未处理的 rejection。其他:干净 worktree 里
pnpm lint以 0 退出;node --test 'scripts/checks/*.test.mjs'全过;pnpm run check:duplication没有新增重复;只读 agent 评审过,一条 P1(ACP 对已退出命令的 PID 调taskkill,PID 可能已被复用)和几条 P2 已改。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.