Repository navigation
test(e2e): run the TUI with the Kitty keyboard protocol, ACP with a bare editor, and Chinese prompts - #5399
test(e2e): run the TUI with the Kitty keyboard protocol, ACP with a bare editor, and Chinese prompts#5399RealKai42 wants to merge 4 commits into
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: |
b5b1917 to
74152a2
Compare
…editor, and allow Chinese prompts Two more ways to run the existing scenarios and self-tests, each its own Playwright project: - tui-kitty: the driver plays a terminal that supports the Kitty keyboard protocol. It follows the protocol sequences the CLI writes, answers the flags query, and sends Esc and the Ctrl keys in Kitty encoding with release events when asked. Start-up fails if the CLI does not use the protocol or falls back to modifyOtherKeys, and expectTerminalRestored() requires the protocol to be off again after the CLI exits. - acp-bare: the editor declares no fs or terminal capability and handles no such requests. The product reads, writes and runs commands itself; a command's output is read from the tool call text. The three cases about a running command's output are not applicable there, since the agent only reports the output once the command ends. Scenarios can leave a variant out with exceptVariants. The run summary names variant projects from the Playwright config. send(), queue() and steer() accept any single line of printable text, and two scenarios cover a Chinese prompt and reply, including wrapping in a narrow window.
- The three running-output cases left out of acp-bare now say they are a product gap awaiting the owner's decision; the guide allows such an exclusion only for a recorded gap the owner agrees to. - The Kitty terminal also sends release events for the arrow keys when asked, and fails when the CLI asks for flags it does not emulate or pops more levels than it pushed.
74152a2 to
9a8999f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a8999fc81
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| private missingEditorEvidence(tool: ToolView, expectation: ToolExpectation): string | undefined { | ||
| if (expectation.status === 'rejected' || this.replayedTurn()) return undefined; | ||
| if (expectation.status === 'rejected' || this.replayedTurn() || this.bare) return undefined; |
There was a problem hiding this comment.
Preserve question-response evidence in bare-editor mode
In acp-bare, this early return also bypasses the AskUserQuestion check below, although the bare editor still implements session/request_permission. Consequently, expectTool({ name: 'AskUserQuestion', ..., status: 'done' }) accepts a completed tool notification even if the editor never answered that question, masking regressions in the question flow. Only filesystem and terminal evidence should be waived for missing editor capabilities; keep the question-response check active in both ACP variants, as required by the documented expectTool contract.
AGENTS.md reference: tests/e2e/AGENTS.md:L95-L95
Useful? React with 👍 / 👎.
Requirement or Bug
新 E2E 的 TUI 只测到一种终端(不支持 Kitty 键盘协议的老式终端),ACP 只测到一种编辑器(声明了 fs 和终端能力的),提示词也只能是 ASCII。用户那边:Ghostty、Kitty、WezTerm、新版 iTerm2 都走 Kitty 键盘协议;不少编辑器不声明终端能力,产品要自己跑命令;中文用户用中文提问。这个 PR 补上这三种情形。
基于 MoonshotAI/kimi-code#5398,这个 PR 的 base 是它的分支
test/e2e-session-verbs。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
核心思路:同一套场景和自测多跑两种「跑法」,各是一个 Playwright project;驱动按跑法扮演不同的终端或编辑器。
tui-kittyacp-bare其他:
exceptVariantssend、queue、steer接受任意单行文字;新场景「中文提问和回复」(四个面)、「窄窗口里中文折行」(TUI、Web)tui和tui-kitty,ACP 作业同时跑acp和acp-bare负责人已同意先排除(2026-11-25):
acp-bare下有 3 条「命令运行中的输出」相关的用例红:编辑器不提供终端时,产品要等命令结束才给出输出,用户看不到长命令的进度。ACP 协议允许在运行中更新工具调用的内容,所以这是产品缺口,不是协议做不到。这个 PR 用exceptVariants排除这 3 条,理由开头写明Product gap;产品修好之后去掉排除。关键决策:
Behavior Changes and Affected Users
产品代码没有改动,受影响的是写和跑新 E2E 的人,以及 CI。
验证结论:两种跑法下现有的场景和自测全部再跑了一遍;Kitty 跑法的启动检查和按键编码做过破坏性检查。
验证细节
本机 macOS arm64,构建产物,这个 PR 的头上:
tui+tui-kitty+acp+acp-barewebdesktop破坏性检查:
acp-bare第一次全套:140 条过,3 条红都是「命令运行中的输出」:编辑器不提供终端时产品要等命令结束才给出输出。这 3 条按上面说的先排除,负责人已同意。评审:只读 agent 报了 1 条 P1,就是这 3 条的理由写成了协议做不到,已改成如实写产品缺口;P2:方向键补了松开事件,CLI 要了不模拟的标志位、多弹出一层都报错。干净 worktree 里
pnpm lint以 0 退出,pnpm run check:duplication 3ce987582没有新增重复。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.