TanStackOSS
    ai
    fix(ai-client): bail out when stream is cancelled during onResponse await Capturing the AbortController signal locally avoided the original null deref but exposed a latent deadlock: when stop() runs during the onResponse await, cancelInFlightStream() calls resolveProcessing() before waitForProcessing() has set processingResolve, so the call is a no-op. Post-fix, streamResponse no longer crashed on the now-null controller, reached waitForProcessing() (creating a fresh resolver nothing would resolve), and hung on `await processingComplete` — breaking the ai-react useChat unmount test. Add a `signal.aborted` check after the onResponse await to short-circuit cancelled or superseded streams cleanly, restoring main's pre-fix flow control without relying on a thrown TypeError. Update the two race tests to reflect the correct semantics: cancelled streams must not invoke the connection layer or surface errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
    nx run-many --targets=build --exclude=examples/**
Succeeded
CI Pipeline Execution

nx run-many --targets=build --exclude=examples/**

Click to copy
Linux
4 CPU cores
6398b777377
52%

Cache hits

16 of 31 tasks used cache.

Get faster results

Learn how to enable distribution.

Atomizer enabled

31 groups of tasks optimized.

© 2026 - Nx Cloud

Terms of ServicePrivacy PolicyChangelogStatusDocsContact Nx CloudPricingCompany@NxDevTools