fix(daemon-client): report the caller deadline when the restart health probe runs to it
Summary
Root cause: after an instance mismatch, retryAfterRemoteInstanceMismatch probes /health with the remaining RPC budget. The probe's timer can fire a few ms before performance.now() reaches the deadline. The remaining-time check then saw a sliver of budget, so the failed probe was classified as Remote daemon is unavailable instead of daemon_transport_timeout. A loaded CI runner hits this and a fast local machine does not.
Fix: the health probe now reports which event ended it. Its own budget timer sets a typed timedOut outcome (internal to daemon-client). The retry throws the request timeout only when the probe timed out and its budget was the caller's remaining time. Refusals, resets, aborts and 5xx still report Remote daemon is unavailable. The public return shapes of readRemoteDaemonHealth and RemoteDaemonHealth are unchanged; two wire-ledger digests were re-pinned (health request and payload are unchanged).
Found on unrelated PR CI (#3014, #3025, #3029, #3033, #3036).
Validation
- Commit 3c5d77be7a
daemon-client-transport.test.tspassed 20/20 in a loop.pnpm check:affected --run: all runnable checks passed (including daemon-wire-compat).- Tests: the early-timer test skews
performance.nowby 50 ms and asserts/healthwas reached; it fails on the previous code. A new test has/healthreturn 503 near the deadline and expectsRemote daemon is unavailable; it fails if any failed probe near the deadline is treated as a timeout.