test(desktop): fence staged steering in slash-command E2E
#2916 aperta il 12 ago 2026
Metriche repository
- Star
- (1 stella)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Problem
The Desktop E2E test dispatches a staged slash command instead of steering it into a running turn is flaky under CI load.
Observed failure:
Locator: locator('.maka-quote-workbar-panel')
Expected: 1
Received: 0
Timeout: 10000ms
CI example: https://github.com/maka-agent/maka-agent/actions/runs/31593434388/job/94103386532
The focused test passes locally, including repeated runs, so this is timing-sensitive rather than a deterministic feature failure.
Introduction
The scenario was introduced by #2612. #2651 fixed an earlier readiness race in the same test—the test used to treat the Stop button as proof that the first Session was ready—but the later staged-steering submission still has no completion fence.
Root cause
The test submits /compact explain while a Turn is running and immediately starts the /side flow.
Composer form submission launches asynchronous sendCurrent() without awaiting it. While the first command is awaiting sessions.steer, sendPendingRef.current remains true. Under slower CI scheduling, the final Enter for /side discuss separately can arrive during that window; sendCurrent() rejects the overlapping submission, so no side-chat panel is created and the locator times out.
This explains why focused local runs pass: the steering IPC normally settles before the second Enter.
Suggested fix
Make the E2E wait for an observable completion boundary for the first staged steering submission before starting the /side command—for example, wait for its acknowledged steering output or another stable UI contract that proves sendPending has settled.
Avoid increasing the 10-second locator timeout: the missing panel is caused by an ignored overlapping submission, not slow panel rendering.
Acceptance criteria
- The test explicitly fences the first staged steering submission before submitting
/side - The focused scenario remains stable under repetition and CI load
- The assertion continues to verify that the staged command was routed as steering and that
/sideopens a side chat
问题
Desktop E2E 用例 dispatches a staged slash command instead of steering it into a running turn 在 CI 负载下存在不稳定失败。
观察到的失败:
Locator: locator('.maka-quote-workbar-panel')
Expected: 1
Received: 0
Timeout: 10000ms
CI 示例:https://github.com/maka-agent/maka-agent/actions/runs/31593434388/job/94103386532
该用例在本地定向及重复运行时可以通过,因此这是时序问题,不是确定性的功能失败。
引入来源
这个场景由 #2612 引入。#2651 修复了同一测试中更早的一处 readiness race——测试曾把 Stop 按钮出现误当成首个 Session 已就绪——但后续 staged steering 提交仍缺少完成边界。
根因
测试在 Turn 运行期间提交 /compact explain,随后立即开始 /side 流程。
Composer 的表单提交会启动异步 sendCurrent(),但事件处理本身不会等待它完成。在第一条命令等待 sessions.steer 时,sendPendingRef.current 会保持为 true。在较慢的 CI 调度下,最终提交 /side discuss separately 的 Enter 可能落入这个窗口;sendCurrent() 会拒绝重叠提交,因此 side-chat panel 根本没有被创建,locator 最终超时。
这也解释了为什么本地定向运行通常通过:steering IPC 往往能在第二次 Enter 前完成。
建议修复
E2E 在开始 /side 命令前,应等待第一条 staged steering 提交的可观察完成边界,例如等待对应的 acknowledged steering 输出,或等待另一个能稳定证明 sendPending 已结束的 UI 契约。
不建议单纯增加 10 秒 locator timeout:panel 缺失是因为重叠提交被忽略,而不是 panel 渲染较慢。
验收标准
- 测试在提交
/side前显式等待第一条 staged steering 提交完成 - 定向重复运行和 CI 负载下保持稳定
- 仍然验证 staged command 被作为 steering 路由,并且
/side能打开 side chat