agents@0.11.8

cloudflare/agentsagents@0.11.8Apr 28, 2026by github-actions[bot]

AI Summary

Adds support for external abort signals and updates the `SaveMessagesResult` status type to include 'aborted'.

Key Highlights

  • Added `AbortRegistry.linkExternal` for programmatic cancellation.
  • Added 'aborted' status to `SaveMessagesResult` union.
  • Exposed `SaveMessagesOptions` from `agents/chat`.
  • Supports detaching external signals to prevent leaks.

New Features

  • External abort signal integration
  • New abort status type
  • Exposed options API

Full Release Notes

### Patch Changes

-   [#1411](https://github.com/cloudflare/agents/pull/1411) [`2fa68be`](https://github.com/cloudflare/agents/commit/2fa68bea891e1bd8f30839586c2519627f364b0c) Thanks [@threepointone](https://github.com/threepointone)! - Add `AbortRegistry.linkExternal(id, signal)` for connecting external `AbortSignal`s to per-request abort controllers, and add `"aborted"` to the `SaveMessagesResult.status` union ([#1406](https://github.com/cloudflare/agents/issues/1406)).

    `linkExternal` is the integration point for callers that drive a chat turn programmatically and want to cancel it from outside without knowing the internally-generated request id (the helper-as-sub-agent pattern, where a parent's `AbortSignal` from the AI SDK tool `execute` needs to land inside a sub-agent's `saveMessages` call). When the external signal aborts, the registry's controller for `id` is cancelled — the same path `chat-request-cancel` takes over the WebSocket. The returned detacher must be called in `finally` to avoid leaking listeners on long-lived parent signals.

    `SaveMessagesResult.status` now includes `"aborted"` alongside `"completed"` and `"skipped"`. Existing callers that only switch on `"completed"` are unaffected; turns cancelled via the new signal API surface as `"aborted"` rather than `"completed"`.

    Also exposes `SaveMessagesOptions` from `agents/chat` for use by `@cloudflare/think` and `@cloudflare/ai-chat` typed APIs. `AbortRegistry.cancel(id, reason?)` now accepts an optional reason that flows through to `signal.reason` on the cancelled controller.

    See [`cloudflare/agents#1406`](https://github.com/cloudflare/agents/issues/1406) for the motivating use case.

-   [`ca510d4`](https://github.com/cloudflare/agents/commit/ca510d4fecbecb07d0d3cdad7d78c32cc226275e) Thanks [@threepointone](https://github.com/threepointone)! - Tighten internal peer dependency floors to reflect the current monorepo set we actually test against: `@cloudflare/ai-chat` (`>=0.0.8` → `>=0.5.2`) and `@cloudflare/codemode` (`>=0.0.7` → `>=0.3.4`). Upper bound (`<1.0.0`) is unchanged.

    No runtime change in `agents` itself. The visible effect for consumers: pairing the latest `agents` with a stale `@cloudflare/ai-chat` (`<0.5.2`) or `@cloudflare/codemode` (`<0.3.4`) now produces a peer warning where it previously did not. That's the intended signal — those older combinations are no longer tested in the monorepo.