agui-bridge-state-events 的 S4 用例流连接数恒 0——卡住 #3225 / #3226 / #3229 三个 PR
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 现象
三个**互不相干**的 PR(#3225 阶段条按需渲染、#3226 通知面板、#3229 失败原因枚举)在 `gates-test (3)` 上同红一条,其余车道全绿,同分片 240 文件 / 1962 用例只红这一条:
```
FAIL tests/agent-runtime/agui-bridge-state-events.test.ts
> S4 detached observer cannot prevent executor plan and final message persistence
Error: Matcher did not succeed in 10000ms
❯ tests/agent-runtime/agui-bridge-state-events.test.ts:324:72
324 | await expect.poll(() => streamConnectionCount, { timeout: 10000 })…
Caused by: AssertionError: expected 0 to be greater than 0
```
**SSE 流连接从头到尾没建立**(计数恒 0),不是断言值算错。
## 已排除 / 未排除(coordinator 的分诊,请复核)
- **不是新增用例**:`S4` 来自 #2890,很早就有。
- **不是 #3200 引入**(初判被自己推翻):#3225 与 #3229 **含** #3200(`82589c915`)仍红;而 #3226 经 `merge-base --is-ancestor` 判为**不含** #3200 也红同一条。**⇒ 两边都红,#3200 不是充分也不是必要条件。但请自己复核这个判定**,我是在 CI 结果与分支血统之间对照得出的,没有本地复现。
- **main 未知红**:最近一次跑完的 `gates-test (3)` 在 `6fd11c596` 是 success,更新的几趟当时仍 pending。**请查 main 现在的状态**——若 main 也红,这是存量问题,三个 PR 不该被它挡住。
- **耗时 10133ms**,恰好等于该断言的 10 秒预算 ⇒ 是「等不到」,不是「跑得慢」。⚠ 注意与 #3200 修掉的那个 30s/120s 确定性挂起**不是同一件事**。
## 首要嫌疑(可证伪,先写预测再取证)
`streamConnectionCount` 恒 0 说明**没有客户端连上那条 SSE**。三种方向:
- (a) 服务端根本没起来 / 端口没监听(注意 #3043 曾把 `listen(0)` 一律绑回环并加了门控);
- (b) 连接建立了但计数器没被记(计数口径与实际连接是两处事实);
- (c) 前一条用例的 teardown 提前掐了连接或关了 server——#3200 新增了 `closeAppDeterministically` / `closeHttpServerDeterministically`(**先掐连接再关**),若作用域过宽会影响后续用例。
**(c) 与「#3226 不含 #3200 也红」矛盾**——请优先解释这个矛盾,或推翻我对 #3226 血统的判定。
## 交付要求
- **先本地复现**,拿到真实的连接建立日志;复现不了就说,不要盲修。
- **不许调大那 10 秒超时**——那是把「等不到」藏起来。#3200 的先例:真根因是活性没有自己的 deadline,修法是让被测对象自己收敛,不是放宽预算。
- 反证必做,先确认断言真的红。
- ⚠ **这条卡着三个 PR 的合入,人类正在等一版可测的产物**,请优先给出「是存量红还是回归」的判定,再谈修法。
Contributor guide
No contributing guide indexed for this repository
Research direction
Run the focused S4 test in tests/agent-runtime/agui-bridge-state-events.test.ts first and confirm the failure at line 324. Inspect the test’s SSE server setup, streamConnectionCount, and teardown paths, then compare current main with the three PR ancestries. Done means identifying whether this is a baseline failure or regression with real connection evidence, without extending the timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100