Repository navigation
test(traex): 覆盖改名命令的粘贴边界 - #3903
Merged
deepcoldy merged 2 commits intoNov 27, 2026
Merged
Conversation
added 2 commits
November 26, 2026 10:09
Co-authored-by: codex
Co-authored-by: codex
lijason1121
marked this pull request as ready for review
November 27, 2026 05:49
lijason1121
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
November 27, 2026 05:49
deepcoldy
reviewed
Nov 27, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
复审结论:0 阻断 / 0 P2,可合。
审查基准与影响面
- 远端 head 已复核为
7e1b1bcb189ba6127c04ac113b88c4a0dab4507e。 - 基于最新
origin/master(44c5de033f)重放后,净 diff 的 stable patch-id 与原 PR 完全一致:584ffb9df8ca5e819bf3184a7743b96ec7003cf8。 - 仅修改
test/raw-command-write-options.test.ts(+18/-2),src/零改动,不改变任何 CLI、后端或会话类型的生产行为。
测试审查
test/raw-command-write-options.test.ts:10-22直接调用真实纯函数和真实 TraeX 适配器,覆盖单行标题正向分支,以及其他命令、空标题、内嵌换行、ESC、C1 的拒绝分支;不依赖 TraeX 二进制存在。test/raw-command-write-options.test.ts:24-35新增 OpenCode 收到同一/rename 项目 A时的对照,钉住bracketedPaste为 falsy、原有pasteLine仍开启,能防止 TraeX 特例泄漏到其他 CLI。- 实际 TraeX 改名链路已核对:
src/adapters/cli/traex.ts:798构造命令,src/worker.ts:31005-31021经 raw writer 发送,src/worker.ts:5773始终传入字符串content,最终由src/core/raw-command-writer.ts:94-100括号粘贴后单独提交 Enter。 - 符合仓库测试原则:断言真实行为,不读取源码文本、不钉文案或内部常量。
本地验证与变异复验
bun run test test/raw-command-write-options.test.ts:12/12 通过。bun test test/raw-command-write-options.test.ts:12/12 通过。bun run typecheck:通过。- 以下六组独立变异均在 Vitest 与 Bun 双引擎咬红,失败数依次为:去掉 TraeX 适配器限制 1;控制字符过滤放宽为
.+2;+放宽为*1;去掉行尾$3;/rename放宽为/\w+1;关闭正向分支 1。 - 变异后源码已恢复并复核 md5 为
c2be054e6f72cfbff4a68d7b67f7cc19,工作树干净;恢复后双引擎再次各 12/12 通过。 - 另用 Node 与 Bun 直接探针核验末尾换行边界:
/rename first\n、/rename first\r、/rename first\r\n均返回bracketedPaste=false,不存在$导致末尾 CR/LF 被误放行的问题。
CI
精确 head 对应主工作流 run 45936193905 的 14 个 job 全部 success(build、Vitest 4 分片、Bun 4 分片、三个 binary job 及两个聚合检查),无失败项。
Owner
|
感谢补充 #3834 的回归测试!本 PR 已合入 master(squash 1f677e2)。 评审中验证过的内容:
一个可选的后续项(不阻塞,仅供参考): 这是自动评审的初步意见,最终以维护者审阅为准。 |
|
@lijason1121 @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 7fe5bdc…63f6dcb16(4 个提交),同批合入的还有 #3904 #3880 #3907,失败不一定由本 PR 引起。
|
This was referenced Nov 27, 2026
|
🚀 Released in v3.59.36 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
补充 #3834 的回归测试。该修复让 TraeX 在终端暂停读取后仍能区分改名文本和提交键,避免下一条消息进入标题。
本 PR 只修改
test/raw-command-write-options.test.ts。表驱动用例验证带空格的中文单行标题会使用括号粘贴,其他命令、空标题、带换行或控制字符的标题沿用常规输入。对 OpenCode 传入相同的改名命令时,仍使用其原有的 paste-line 模式。验证
test/raw-command-write-options.test.ts,两次均为 12 项通过。已知全量测试结果
提交
7e1b1bcb1的构建、workflow-core 和 Node 全量测试通过(62,477 项通过、255 项跳过)。Bun 全量曾通过 2,679 个文件,随后两次复验均为 2,678 / 2,679 个文件通过。唯一失败是test/platform-tunnel-data-bridge.test.ts的背压用例,TCP 写端统计值为 40 MiB,超过断言的 32 MiB;该文件单独复测 12 项通过。此 PR 保留草稿供 CI 验证。