You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7bfcec4
Browse filesBrowse the repository at this point in the historyBrowse files
test(ws-upstream): prove the rewrite chain through handleResponses, not the factory
The `eager-relay marker preconditions` test asserted only that
`createResponsesFieldBackfillBlockRewrite()` returns a function. That would stay
green if `handleResponses` stopped adding it to `blockRewrites`, so it did not
actually protect the contract the two marker assertions depend on.
Replace it with an integration case in the existing `handleResponses` describe:
drive a Responses stream whose `output_text` part omits the required
`annotations` field, then read the client bytes back. Seeing `annotations: []`
there is only possible if the rewrite is registered and ran, which is exactly
what makes `clientBlockRewrite !== undefined` and `needsClientRewrite === true`.
The platform half stays a pure unit test on the real exported helper.
Verified on win32, exact head:
- bun run typecheck exit 0
- bun test tests/ws-upstream.test.ts 25 pass / 0 fail
Mutation-checked:
- dropping `createResponsesFieldBackfillBlockRewrite()` from `blockRewrites`
fails the new case on `toHaveProperty("annotations")` (3 fail)
- widening `isWin32EagerRewrite` past win32 fails the truth table (1 fail)
Still test-only; no runtime change.
0 commit comments