Skip to content

[BUG] SDK sendRequest ignores caller abort signals #1443

Open

Description

@lux-liang

Describe the bug

VoltAgentCoreAPI.sendRequest(path, init) accepts RequestInit, but ignores its signal. A POST whose signal has already been aborted still reaches the server and resolves normally. Aborting after dispatch or while reading the returned response body is also ignored.

Steps To Reproduce

With @voltagent/[email protected], create a VoltAgentCoreAPI pointing to a local HTTP server. Abort an AbortController before calling:

const controller = new AbortController();
controller.abort();
await api.sendRequest("/test", {
  method: "POST",
  body: "{}",
  signal: controller.signal,
});

The server receives the POST and the call resolves. I also reproduced ignored cancellation after dispatch and after response headers against a delayed local HTTP response. Normal requests and the SDK's configured timeout still work.

Expected behavior

Caller cancellation should propagate through the request and response body, including preventing dispatch when the signal is already aborted. Caller cancellation should remain distinguishable from the SDK request deadline.

Packages

Additional Context

Also reproduced using the unmodified SDK client source from main at 72a46c76b4507e1f98b41d5050a92bd30587eb70 with real dependencies and native fetch. fetchWithTimeout currently replaces init.signal with its own controller signal.

I plan to add public request cancellation regressions and preserve the caller signal alongside the configured SDK timeout.

Prepared with AI assistance; reproductions use the actual SDK and native fetch against a local HTTP server.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions