test(pi): Windows CI 账号边界 live fence 测试出现不稳定失败
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 401
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 问题
PR #4179 的 client-ci 第 2 次运行在 Windows 分片 2/2 出现 Pi 账号边界测试失败。该 PR 只改 BotModelChainEditor 与其 Renderer 测试,packages/maker-core 相对基底 56c0e5002 无改动。
## 证据
[失败 job](https://github.com/makecindy/cindy/actions/runs/34333287664/job/102412744870),PR head 3e97f5aec1244cb2d77413ffcd8123c36aa527c8。
`packages/maker-core/src/agents/pi/__tests__/pi-startsession-cleanup.test.ts:1340`
用例:`an account boundary that rises inside an approval publish > hands the helper a predicate that reads the live fence, not a snapshot`
调用 `handle.close({ reason: 'account-boundary' })` 后,`expect(fixture.gate()?.()).toBe(false)` 得到 true。该分片 maker-core 共 2208 项通过、1 项失败。Desktop 已全部通过;首轮本 Pi 测试未失败,首轮失败另为 Desktop Vitest onTaskUpdate RPC 超时,两次不是同一故障。
本机 macOS 同一 head 使用单 worker 定向执行该用例通过(1 passed),不能据此认定 Windows 已修复。
## 需要调查
复现 Windows 单文件/整包执行差异,核对 close 在 accountBoundaryTeardown 置位前的同步调用是否抛错,以及测试 fixture/后台任务交互。当前仅为调查方向,尚未确认根因。
## 边界与验收
独立于 #4179 备用模型编号修复跟踪。账号边界属于权限不变量,不能删除断言、skip 用例或放宽门禁;修复需保持 close 后禁止写入旧账号 mailbox,并通过 Windows CI。
Contributor guide
Research direction
Start with packages/maker-core/src/agents/pi/__tests__/pi-startsession-cleanup.test.ts at line 1340, running the named test on Windows in single-file and full-package modes. Trace handle.close({ reason: 'account-boundary' }) alongside accountBoundaryTeardown and the fixture's background tasks, checking for synchronous errors. Done means the cause is identified, the assertion and old-account mailbox invariant remain intact, and Windows CI passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- authorization, ci-cd, operating-systems, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100