Summary
A Windows root-test shard intermittently fails the HostSessionClient confirm auto-deny test even though the correct deny frame reaches the wire. The test currently treats completion within 50 ms as the contract, which makes correctness depend on shared-runner scheduling latency.
Reproduction
Run:
bun test packages/senpi-task/src/runners/rpc-host/session-client-records.test.ts
In a loaded Windows CI shard, the test #then a deny answer is on the wire within 50 ms observed the correct frame after 55.2205 ms and failed only the elapsed-time assertion.
Expected
- A confirm UI request is answered with
confirmed: false.
- The auto-answer path does not wait for a human-facing timeout or block subsequent session commands.
- The test asserts this ordering contract deterministically, without a wall-clock latency budget.
Actual
The payload assertion passes, but the test fails when shared-runner scheduling pushes observed elapsed time above 50 ms.
Evidence
packages/senpi-task/src/runners/rpc-host/session-client-records.test.ts:42-55 measures performance.now() around socket delivery and asserts < 50.
packages/senpi-task/src/runners/rpc-host/session-client.ts:206-214 builds the safe deny/cancel response and dispatches sendExtensionUIResponse without awaiting it; there is no timer on the product path.
- Windows CI observed
Received: 55.220500000003085 after receiving { type: "extension_ui_response", id: "ui-1", confirmed: false }.
- A 50-run focused macOS control passed, consistent with scheduler-dependent timing rather than a protocol defect.
Root cause
Confirmed test flake: the assertion measures end-to-end wall-clock latency across the socket and CI scheduler instead of the product contract. The product path already dispatches the deny immediately and does not await a UI timeout.
Scope
- Replace the elapsed-time assertion with a deterministic ordering/non-blocking assertion.
- Keep the product path unchanged unless additional runtime evidence reveals an accidental await or timer.
- Prove the fixed test with three focused Windows soak runs of 10 iterations each.
Acceptance criteria
- The confirm request produces the expected deny frame.
- A subsequent session command completes without waiting on the UI response path.
- No fixed sleep, polling delay, enlarged timeout, retry, or platform skip is introduced.
- Three focused Windows soaks pass 10/10 iterations.
Related
Summary
A Windows root-test shard intermittently fails the HostSessionClient confirm auto-deny test even though the correct deny frame reaches the wire. The test currently treats completion within 50 ms as the contract, which makes correctness depend on shared-runner scheduling latency.
Reproduction
Run:
bun test packages/senpi-task/src/runners/rpc-host/session-client-records.test.tsIn a loaded Windows CI shard, the test
#then a deny answer is on the wire within 50 msobserved the correct frame after 55.2205 ms and failed only the elapsed-time assertion.Expected
confirmed: false.Actual
The payload assertion passes, but the test fails when shared-runner scheduling pushes observed elapsed time above 50 ms.
Evidence
packages/senpi-task/src/runners/rpc-host/session-client-records.test.ts:42-55measuresperformance.now()around socket delivery and asserts< 50.packages/senpi-task/src/runners/rpc-host/session-client.ts:206-214builds the safe deny/cancel response and dispatchessendExtensionUIResponsewithout awaiting it; there is no timer on the product path.Received: 55.220500000003085after receiving{ type: "extension_ui_response", id: "ui-1", confirmed: false }.Root cause
Confirmed test flake: the assertion measures end-to-end wall-clock latency across the socket and CI scheduler instead of the product contract. The product path already dispatches the deny immediately and does not await a UI timeout.
Scope
Acceptance criteria
Related