-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
Description
In my project, I combined two abort signals. In my scenario, I need to allow users to manually abort the request while also triggering an abort due to a timeout after a certain period of time.
const timeoutSignal = AbortSignal.timeout(timeout)
const signals = [timeoutSignal]
if (externalSignal) {
signals.push(externalSignal)
}
const finalSignal = AbortSignal.any(signals)However, the reason fields for these two types of abort signal are different. At present, when an abort is triggered, the abort chunk returned by the aisdk does not include the reason for the abort. I would like to be able to determine the abort reason directly from the abort chunk so that I can clearly inform the user about why the request was aborted.
Of course, I know I could achieve this by managing my finalSignal separately, but that seems a bit too cumbersome for me.
AI SDK Version
ai: 5.0.98
Code of Conduct
- I agree to follow this project's Code of Conduct