Repository navigation
fix(codex-app): 区分异步文字提醒与提问卡 - #3886
Conversation
- collector 直接单测覆盖 async question(含 commentary phase 的 delta 路径) 与 questions 缺失/null 两种纯文字提醒,变异验证两处分流守卫均能咬红 - 集成断言补上 delta 首行泄漏检查(原断言只覆盖 completed 整段文本), 顺带修正一处缩进 Co-Authored-By: Claude Fable 5 <[email protected]>
|
自动评审初步意见(最终以维护者审阅为准)。 分流逻辑本身没有发现阻断问题: 评审中做变异复验时发现一处测试覆盖缺口,已在 3026bab 直接补上(仅测试,未改实现):
本地验证: |
deepcoldy
left a comment
There was a problem hiding this comment.
复审结论(3026bab5)
主流程没有发现阻断问题:questions != null 的提问仍进入既有 ask broker,缺失/null 的纯文字提醒只发布一次进度和终端输出,collector 对 async 提问的 delta/completed 两条泄漏路径均有测试守住。
P3(nit):纯文字提醒可能与后续终端输出连行
- 位置:
src/codex-app-runner.ts:1641 - 新分支将
item.text原样传给RunnerControlWriter.display;该方法只写原始文本,不补行边界(src/adapters/cli/runner-control-channel.ts:25-27)。 - 现有
async-user-input-plain场景已经能复现:提醒Complete sign-in in your private terminal.没有尾随换行,随后输出Independent work completed,实际 stdout 为:Complete sign-in in your private terminal.Independent work completed - 探针证据:在现有 plain 集成用例中临时增加
expect(harness.stdout).not.toContain(${text}Independent work completed),单用例如预期失败并显示上述连行;恢复探针后工作区干净。建议在文本未以\n结尾时补一个换行,并在该场景增加行边界断言。 - 影响仅限 Web 终端的可读性;thinking marker、最终回复内容和提问卡流程不受影响,不列为合并阻断。
本地验证
bun run build:通过。bunx vitest run test/codex-app-cot.test.ts test/codex-app-runner-protocol.test.ts test/codex-app-runner.integration.test.ts:3 个文件、164 项通过。- 相邻 turn 生命周期测试:8 个文件、134 项通过。
- worker 侧 Codex App 回归测试:9 个文件、187 项通过。
git diff --check 1d4dd5bbb7..3026bab5ca:通过;探针运行后无残留测试进程。
当前 head 的 GitHub 记录只有 network-boundary 检查,仍为 queued,因此本结论不包含 CI 全绿声明。
无 questions 的 async agentMessage 原样 display,缺少尾随换行时会与
后续终端输出连成同一行。仅在 PTY 输出侧按 endsWith('\n') 条件补换行,
thinking marker 仍使用原始文本;plain/plain-null 集成用例增加行边界
断言,变异验证能咬红。
Co-Authored-By: Claude Fable 5 <[email protected]>
|
复审指出的 P3(纯文字提醒与后续终端输出连行)已在 7e65d44 修复。 修法: 验证:摘掉换行补全的变异下两个用例按预期咬红、恢复后通过; |
deepcoldy
left a comment
There was a problem hiding this comment.
复审结论(7e65d445)
此前报告的终端连行 P3 已修复;本次增量复审没有发现新问题,无阻断,可合。
src/codex-app-runner.ts:1645只在 PTY display 前条件补\n,已有换行不会重复添加;params.item.text未被改写,后续publishTurnThinking仍消费原始通知文本。test/codex-app-runner.integration.test.ts:876-877同时钉住“禁止连写”和“必须存在行边界”,覆盖plain与plain-null两条路径。
本地验证
bun run build:通过。bunx vitest run test/codex-app-cot.test.ts test/codex-app-runner-protocol.test.ts test/codex-app-runner.integration.test.ts:3 个文件、164 项通过。- 变异复验:临时将条件补换行恢复为
output.display(item.text),plain/plain-null两个用例如预期咬红,实际输出仍为Complete sign-in in your private terminal.Independent work completed;恢复实现后两个用例通过。 - 已有换行分支探针:临时让 plain fixture 的提醒自带
\n,两个用例通过,确认不会重复补行;恢复 fixture 后再次通过。 git diff --check 3026bab5ca..7e65d445c4:通过;所有探针均已恢复,工作区干净,无残留测试进程。
当前 head 已登记的 network-boundary 检查通过(2m5s):https://github.com/deepcoldy/botmux/actions/runs/45812193735
|
感谢贡献,已合并进 master(6029b8d)。 这个修复把 目前没有遗留的 follow-up 事项。欢迎继续贡献。 |
|
@uestcwangci @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 689970b…36f11a21e(11 个提交),同批合入的还有 #3846 #3881 #3870 #3869 #3868 #3877 #3875 #3876 #3885 #3883,失败不一定由本 PR 引起。
|
|
🚀 Released in v3.59.35 |
问题
Codex App Server 用
agentMessage.delivery=async同时表示普通文字提醒和异步提问。Botmux 原先把两者都交给提问卡解析器,纯文字事件缺少questions时,飞书会误报提问格式不支持。改动
null的questions走当前轮的进度输出,Web 终端也会显示该文字。重复的完成事件只显示一次。验证
bun run build通过。相关 runner、进度和提问测试共 219 项通过。v3.59.33上应用同一补丁,18 项异步消息集成用例通过,覆盖无questions、questions: null、重复事件、真实提问作答和格式错误。bun run build:bun和 Linux 二进制启动检查通过。本地部署确认飞书重新连接,原会话用新版 runner 恢复到等待输入。飞书界面中的新提醒待自然触发验证。