mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-11-10 04:27:42 +08:00
An aborted read can stay pending forever: undici drops the error when the abort lands on an in-flight response-body read (observed on the coverage lane's Node v24.13.0), and the stalled body of `llm-retry/tests/transport-recovery.spec.ts` then never settles. The idle watchdog delegated termination to the iterator observing its signal, so the request outlived its own deadline and the agent stayed `running` until Vitest's 90s budget; awaiting the abandoned request generator's `return()` queued behind that demand and would have re-hung the settled outcome. `idleWatchdog.next` now races its demand against its own deadline and rejects with the watchdog's TimeoutReason, so the deadline — not the transport — decides when an outstanding demand ends. Both adapters that consume the watchdog stop awaiting the abandoned generator's drain; the abort they already issue owns socket and SDK teardown. Evidence: instrumented stress harness at ~1s idle on Node v24.13.0 hung 4/160 iterations before this change (each with the abort delivered at ~1002ms and the underlying read never settling) and 0/160 after; Node v24.19.0 never hung. The new case in transport-recovery.spec.ts pins the behavior deterministically: it fails (times out) with the watchdog change alone and with no product change at all.