Skip to content

test(desktop): follow the new / and model menus in composer journeys - #5274

Merged
RealKai42 merged 1 commit into
mainfrom
fix/desktop-e2e-journeys
Nov 23, 2026
Merged

RealKai42 merged 1 commit into
mainfrom
fix/desktop-e2e-journeys

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

Requirement or Bug

Resolve #5265

main 在 7746b1621 的 push 运行(run 45126564648)里有 3 个 Desktop E2E 旅程失败。失败来自 #5093 和 #5247 两次有意的界面改动:它们没改旅程文件,PR 阶段按选测规则不跑全量旅程,所以合入 main 后才暴露。这个 PR 让 3 个旅程跟上新的界面契约,main 恢复通过后,跑全量旅程的 PR 不会再看到同样的失败。

Bug Reproduction Steps

See linked issue。本地在 main 上运行即可复现:

pnpm --filter kimi-code-app run e2e:headless e2e/turn-esc-layering.spec.ts e2e/composer-commands.spec.ts e2e/composer-drafts-models.spec.ts

Root Cause

产品没有 bug,是旅程里的定位和期望还停在旧界面上。这是根本修复:按有意改变的契约更新旅程,不回退产品行为。

旅程 失败处 来源 界面改了什么 有意改动的依据
turn-esc-layering.spec.ts:44 / 菜单里找不到 /^\/compact / 选项 #5093 / 菜单的显示名去掉开头的 /,/compact 显示成 compact 提交说明 "drop the slash in the / menu"
composer-commands.spec.ts:29、33–35 同上,按 /new、/status 等带斜杠的名字找选项 #5093 同上 同上
composer-commands.spec.ts:98(修好上一行后才暴露) 退出 plan 模式后期望占位文字是 Type a message… #5093 桌面端(非移动端、非 Side Chat)空输入框的占位文字改成 Type @ to reference files, or start with / for commands and skills 提交说明 "The empty composer placeholder says how to use @ and /",以及 changeset composer-placeholder-hints.md
composer-drafts-models.spec.ts:98 在快捷模型菜单点了 Swift Stub 后,模型按钮 15 秒内没有变 #5247 快捷模型菜单改成先暂存:点模型或思考档位只移动菜单里的勾选,菜单保持打开;在菜单外点击或按 Cmd/Ctrl+Enter 才提交,Esc 放弃 #5247 行为变化表里的 "Quick model menu" 一行

第三个旅程的定位过程:CI trace 显示对 Swift Stub 的点击已执行完,但 Electron 日志里此后没有任何切换模型的请求;失败时的页面快照里模型按钮仍是 stub,并且 aria-expanded 为 true,菜单还开着。对照 #5247 的实现,原生菜单的模型行带 keepOpen,只有原因为 dismiss 的关闭才会提交暂存的选择。原 spec 在改完思考档位后按 Esc 关菜单,按新契约这会直接放弃选择,所以这几处也要一起改。

同期合入的 #5260 只调整了完整的 "Switch model" 对话框里 provider 标签的顺序,和这次失败无关。

Code Changes

只改了三个旅程文件,没有改产品代码。

  • turn-esc-layering.spec.ts、composer-commands.spec.ts:/ 菜单的选项按不带斜杠的可见名字定位(/^compact /,BUILT_INS 去掉斜杠);退出 plan 模式后,期望占位文字变回新的默认提示。
  • composer-drafts-models.spec.ts:在快捷模型菜单里每做一次选择,都显式提交后再检查模型按钮:
 选 Swift Stub
   点击菜单项 "Swift Stub"
+  菜单里 "Swift Stub" 变为已勾选          # 选择先暂存,菜单仍开着
+  点击输入框                              # 在菜单外点击,提交
+  菜单隐藏
   模型按钮显示 "Swift Stub"
 选 Thinking Stub、High、Off、Remote Stub
   点击菜单项或档位
+  按 Cmd/Ctrl+Enter,菜单隐藏             # applyModelMenu
   模型按钮显示新的模型或档位
-  按 Esc 关闭菜单                         # 新契约下 Esc 会放弃暂存的选择

两种提交方式都覆盖到了:第一次用用户最常走的"在菜单外点击",其余用 Cmd/Ctrl+Enter。原有断言全部保留,只是"模型按钮已变化"挪到了提交之后;另外加了一条"选择后菜单里已勾选"的断言,确认选择是先暂存、后提交的。

另外,已隔离的 settings-appearance.spec.ts 第 118 和 154 行也断言了旧的占位文字。它在 #5093 之前就因别的原因被隔离(见 tests/quarantine.yaml),这个 PR 没有改它;解除隔离时需要一并更新这两处期望。

Behavior Changes and Affected Users

None。只改了 apps/desktop/e2e/ 下的三个旅程文件,没有改产品代码、配置或契约文件;测试改动不需要 changeset。

旅程 改动后守护的契约
turn-esc-layering 输入 / 后出现命令菜单,Esc 先关菜单,不会停止运行中的回合
composer-commands / 菜单列出内置命令并随输入过滤;退出 plan 模式后占位文字回到默认提示
composer-drafts-models 快捷模型菜单先暂存选择,在菜单外点击和 Cmd/Ctrl+Enter 都会提交,所选模型和思考档位进入请求
验证
  • macOS 本地:pnpm --filter kimi-code-app run e2e:headless e2e/turn-esc-layering.spec.ts e2e/composer-commands.spec.ts e2e/composer-drafts-models.spec.ts --repeat-each=2,3 个旅程各跑两遍都通过(连同它们依赖的 smoke 和 gate 项目)。
  • pnpm lint 以 0 退出;apps/desktop 的 tsc --noEmit(包含 e2e/)通过。
  • pnpm run check:duplication 没有新增重复。
  • 没有在 Windows 上运行。改动只涉及 Playwright 的定位和按键,ControlOrMeta 在 Windows 上映射为 Ctrl,产品端 Ctrl 和 Cmd 都接受。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

#5093 drops the leading slash from / menu names and turns the empty
composer placeholder into @ and / hints. #5247 stages quick model menu
choices until an outside click or Cmd/Ctrl+Enter, and Escape discards
them. Three journeys still expected the old names, the old placeholder
and a menu that applies on click, so they failed on main.

Locate / menu options by their visible names, expect the new default
placeholder, and commit each quick model menu choice before checking the
model pill: once with an outside click and otherwise with Cmd/Ctrl+Enter.
@changeset-bot

changeset-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 66eb7bb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T08:06:40.163895Z 66eb7bb PR opened
🔒 Security Review ✅ Completed 2026-11-23T08:07:46.540585Z 66eb7bb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 23, 2026

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

commit: 66eb7bb

@RealKai42
RealKai42 merged commit c0afa48 into main Nov 23, 2026
30 of 32 checks passed
@RealKai42
RealKai42 deleted the fix/desktop-e2e-journeys branch November 23, 2026 08:42
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 25, 2026
Route file download and session media URL calls through a sessionSync
route that answers from the current owner without a session load (MoonshotAI#5336).
Add thoughtsTokenCount to the Google GenAI output usage with thinking and
zero-thinking fixtures (MoonshotAI#5334), update the desktop composer e2e specs for
the label-only slash menu (MoonshotAI#5274), and document the Bash session/workspace
env vars (MoonshotAI#5053).
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.

Desktop E2E journeys are failing on main

1 participant