Repository navigation
Commit 2a20f1d
committed
test(ws-upstream): hold the eager-relay marker to the win32 rule, not to a constant
`tests/ws-upstream.test.ts` has two cases failing on Windows since 5a75e57:
(fail) an HTTP fallback remains on the configured legacy tee path
(fail) an older runtime stays on HTTP SSE without opening a WebSocket
Measured, not inferred -- both bisect endpoints were run rather than assumed:
dec332c 23 pass / 0 fail
5a75e57 21 pass / 2 fail fix(grok): ... backfill required annotations
That commit adds `createResponsesFieldBackfillBlockRewrite()` to `blockRewrites`
unconditionally, and the factory returns an `SseBlockRewrite` rather than
`undefined`, so the chain is never empty and `needsClientRewrite` in
`handleResponses` is now a constant `true`. `isWin32EagerRewrite` is
`platform === "win32" && needsClientRewrite` (src/lib/bun-stream-caps.ts:126),
so on Windows every Responses stream now takes the eager single-reader relay --
which is exactly what #864 asks for, since all traffic is now rewrite traffic.
Instrumented at the gate to confirm the mechanism rather than deduce it:
[EAGER] {"forceCodexWsEagerRelay":false,"useEagerRelay":null,
"win32EagerRewrite":true,"needsClientRewrite":true,
"platform":"win32","blockRewrites":1}
So the source behaviour is intended and the assertions are stale. Both cases are
about the *WebSocket* path not being taken, and both already assert that
directly through `FakeWebSocket.instances`; the `isEagerRelaySseResponse(...)`
assertion was a second-order signal that stopped tracking WS selection on win32.
Holds it to the documented rule instead of to `false`, so it stays honest on
every platform rather than encoding a pre-backfill world.
Adds one precondition case pinning the coupling itself -- the rewrite chain
being non-empty, and the platform rule -- so if either half moves it fails
somewhere that names the real cause instead of inside a WebSocket assertion.
Tests only; no src change. 24 pass / 0 fail in the file (was 21/2), and the new
case is mutation-checked: forcing `isWin32EagerRewrite` to `false` turns it red.
58 pass / 3 skip / 0 fail across ws-upstream, responses-field-backfill,
responses-snapshot-repair-server and subagent-fallback-handle-responses.
`bun run typecheck` exit 0.1 parent fbc6f26 commit 2a20f1d
1 file changed
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
20 | 33 | | |
21 | 34 | | |
22 | 35 | | |
| |||
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
291 | | - | |
| 304 | + | |
292 | 305 | | |
293 | 306 | | |
294 | 307 | | |
| |||
330 | 343 | | |
331 | 344 | | |
332 | 345 | | |
333 | | - | |
| 346 | + | |
334 | 347 | | |
335 | 348 | | |
336 | 349 | | |
337 | 350 | | |
338 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
339 | 373 | | |
340 | 374 | | |
341 | 375 | | |
| |||
0 commit comments