Repository navigation
test(hooks): turn.finished 钩子用例不再读到写了一半的标记文件 - #2554
Merged
Merged
Conversation
用例轮询 hook 写出的标记文件,hook 用 writeFileSync 写:文件在创建后、写入 前对读者可见且为空,读到空串就 break,于是报 expected '' to contain '"event":"turn.finished"'。CI 负载高时命中。hook 改为写临时文件再 rename, 轮询只在读到内容时结束。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 29, 2026 20:09
Owner
Author
deepcoldy
pushed a commit
to uestcwangci/botmux
that referenced
this pull request
Oct 30, 2026
…ity-recovery-2473-final 四次同步 master(0345cc5f1..eb43116,14 提交,含 deepcoldy#2514/deepcoldy#2534/deepcoldy#2535/deepcoldy#2541/ deepcoldy#2467/deepcoldy#2550/deepcoldy#2553/deepcoldy#2554/deepcoldy#2557/deepcoldy#2561/deepcoldy#2562 等)。与本 PR 仅 worker-pool.ts / worker.ts 文件交集,git 自动合并干净、无冲突标记;PR 关键接线(codexApp TurnFailureCode 四处、!turn.error 守卫、pool 恢复落账、worker 签名 final 失败字段、Pi boot 20s 预算)逐处 grep 仍在原位。合并树 build 过、 codex 集成/容量/engine/deployment/schedule 共 276 项 vitest 绿、 容量+Pi argv 46 项 bun 绿。 Co-Authored-By: Claude Code <[email protected]>
|
🚀 Released in v3.56.0 |
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.
现象
#2550 的 CI
test (1/4)红在test/turn-finished-event.test.ts > runs the user hook for an ordinary session and skips it for a VC receiver:本地单独跑是绿的;这个失败与 #2550 的改动(bytedcli 包装器)无关。
根因
这条用例在轮询 hook 子进程写出的标记文件。hook 原来直接用
writeFileSync写,文件创建出来之后、内容写进去之前,读者能看到一个空文件。轮询读到空串时直接break,紧接着断言失败。CI 负载高时 hook 子进程慢,正好落进这个窗口。复现:在 hook 的创建和写入之间加 300ms 延迟。原样代码每次都报完全相同的错误(
expected '' to contain ...)。修法(只改测试)
<marker>.tmp,再rename成正式文件名。这样读者要么看不到文件,要么看到完整内容。验证
npx vitest run test/turn-finished-event.test.ts:5 passed。🤖 Generated with Claude Code