Skip to content

Feature: provide abort reason for abort chunk #11442

@EurFelux

Description

@EurFelux

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions