Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
62d30412 fix(ai, ai-client): honor abort signal in toJSONResponse + test fetchJSON
Address CR findings:
- toJSONResponse now checks `abortController.signal.aborted` on entry
(throws the signal's reason without draining the upstream) and inside
the drain loop (breaks early if aborted mid-stream), matching the
semantics of toServerSentEventsStream and toHttpStream. Previously the
signal was only consulted from the error-path catch handler, so a
pre-aborted controller drained the full stream anyway and a mid-drain
abort was silently ignored.
- Add two new tests covering pre-abort (infinite stream never pulled)
and mid-drain abort (bounded pulls after abort fires).
- Add 8 fetchJSON tests covering happy path, non-2xx, non-array body
with descriptive error, url-as-function, options-as-async-function,
options.body merging, custom fetchClient override, and AbortSignal
propagation — the adapter previously had zero direct test coverage.