The bug
test/unit/client/components/App.ws-bootstrap.test.tsx > "recovers bootstrap-owned provider availability and sidebar filters after transient pre-ready 503s" is load-flaky in full client-suite runs: expected [ 'Manual Session' ], received [ 'Codex', 'Manual Session' ]. It passes 36/36 in isolation. Observed at 4c22976 and at a commit two earlier.
Root cause (empirically established; evidence in #625)
The vitest jsdom environment injects the worker-global Node BroadcastChannel into every test file. Layout broadcasts from OTHER test files (persistMiddleware → freshell.persist.v2) can be delivered into a listener registered later by this file's mounted App (installCrossTabSync → layout hydration), hydrating a codex tab titled Codex into the test store — producing exactly the observed selector diff. Delivery is intermittent by worker/ordering chance (measured 2/6 in a two-file micro-experiment), hence the flake.
Current state
A candidate fix landed as #625 (2300258) and was reverted in #626. The full diff and evidence remain in #625:
App.ws-bootstrap.test.tsx: lifecycle-scoped inert BroadcastChannel stub; _resetSessionWindowThunkState() + _resetTerminalDirectoryThunkControllers() in beforeEach AND afterEach (a second, independently proven in-file residue channel); one added fence assertion. No assertions removed or loosened.
opencode-serve-manager.test.ts: raised onceIdle inner deadline/outer budget and eager attachment of the observation branch — remediation of a DIFFERENT pre-existing load flake, causally unrelated to this fix.
Verification state at the time of the revert: deterministic poison probe red-before/green-after; fixed file 36/36 in isolation and 35/35 in a saturated adversarial sweep including 5 seed-pinned replays of a recorded failing order (seed 1786259877991); 3/3 consecutive fully-green full client-suite runs at that HEAD; server suite showed 3 remote-proxy-family failures that also reproduce at the base commit.
Open items before relanding
- Committed regression protection: a live-channel poison guard was included and then removed because a live channel can itself contaminate other suites. If committed protection is wanted, design it as a non-live-channel test.
- Consider splitting the
opencode-serve-manager.test.ts remediation into its own change — it is causally unrelated.
- Re-verify on current main before landing: fresh 3/3 consecutive full client-suite runs with the target passing, and confirm any server-suite failures reproduce at the base commit.
The bug
test/unit/client/components/App.ws-bootstrap.test.tsx > "recovers bootstrap-owned provider availability and sidebar filters after transient pre-ready 503s"is load-flaky in full client-suite runs:expected [ 'Manual Session' ], received [ 'Codex', 'Manual Session' ]. It passes 36/36 in isolation. Observed at 4c22976 and at a commit two earlier.Root cause (empirically established; evidence in #625)
The vitest jsdom environment injects the worker-global Node
BroadcastChannelinto every test file. Layout broadcasts from OTHER test files (persistMiddleware→freshell.persist.v2) can be delivered into a listener registered later by this file's mountedApp(installCrossTabSync→ layout hydration), hydrating a codex tab titledCodexinto the test store — producing exactly the observed selector diff. Delivery is intermittent by worker/ordering chance (measured 2/6 in a two-file micro-experiment), hence the flake.Current state
A candidate fix landed as #625 (2300258) and was reverted in #626. The full diff and evidence remain in #625:
App.ws-bootstrap.test.tsx: lifecycle-scoped inertBroadcastChannelstub;_resetSessionWindowThunkState()+_resetTerminalDirectoryThunkControllers()in beforeEach AND afterEach (a second, independently proven in-file residue channel); one added fence assertion. No assertions removed or loosened.opencode-serve-manager.test.ts: raisedonceIdleinner deadline/outer budget and eager attachment of the observation branch — remediation of a DIFFERENT pre-existing load flake, causally unrelated to this fix.Verification state at the time of the revert: deterministic poison probe red-before/green-after; fixed file 36/36 in isolation and 35/35 in a saturated adversarial sweep including 5 seed-pinned replays of a recorded failing order (seed 1786259877991); 3/3 consecutive fully-green full client-suite runs at that HEAD; server suite showed 3
remote-proxy-family failures that also reproduce at the base commit.Open items before relanding
opencode-serve-manager.test.tsremediation into its own change — it is causally unrelated.