agents@0.13.3

cloudflare/agentsagents@0.13.3May 26, 2026by github-actions[bot]

AI Summary

This patch release (0.13.3) focuses on improving session management, chat recovery, and sub-agent handling. Key improvements include better auto-compaction estimates, automatic retry for interrupted pre-stream chat turns, and path-scoped identities for new sub-agents.

Key Highlights

  • Improved session auto-compaction estimates with support for custom token counters and error callbacks
  • Chat turn recovery now stashes metadata before inference, enabling automatic retry of interrupted pre-stream messages
  • Agent-generated workflow instance IDs now validated to satisfy runtime requirements
  • In-band stream errors now return proper error statuses across programmatic chat turns
  • Path-scoped identities used for new sub-agents while preserving legacy identities for existing entries

New Features

  • Session auto-compaction now includes frozen system prompt in estimates
  • Custom token counters supported for session management
  • Auto-compaction error callback exposed for error handling
  • Pre-stream interruption recovery with automatic retry of unanswered user messages
  • WebSocket connection state hydration no longer causes facet startup deadlocks

Full Release Notes

### Patch Changes

-   [#1580](https://github.com/cloudflare/agents/pull/1580) [`a1cd51b`](https://github.com/cloudflare/agents/commit/a1cd51b39674edd8fce9214bcc0ce0f9b93917e4) Thanks [@threepointone](https://github.com/threepointone)! - Improve session auto-compaction estimates by including the Session-managed frozen system prompt, support custom token counters, and expose an auto-compaction error callback.

-   [#1559](https://github.com/cloudflare/agents/pull/1559) [`f942ffe`](https://github.com/cloudflare/agents/commit/f942ffe4113bdf074942cc32c2c69922ef633502) Thanks [@cjol](https://github.com/cjol)! - Stash chat turn recovery metadata before inference starts so interrupted pre-stream turns can be reconciled by chat recovery. Pre-stream interruptions now automatically retry the existing unanswered user message when it is still safe to do so.

-   [#1579](https://github.com/cloudflare/agents/pull/1579) [`d0b4d0e`](https://github.com/cloudflare/agents/commit/d0b4d0e8d3a61fe7d03a73e2142595ef9f03d24d) Thanks [@threepointone](https://github.com/threepointone)! - Ensure Agent-generated workflow instance IDs always satisfy the Workflows runtime ID validator.

-   [#1567](https://github.com/cloudflare/agents/pull/1567) [`3cfa498`](https://github.com/cloudflare/agents/commit/3cfa49878c3ff8495f7f2b1b059a04440449bf7b) Thanks [@cjol](https://github.com/cjol)! - Return error statuses for in-band stream errors across programmatic chat turns.

-   [#1578](https://github.com/cloudflare/agents/pull/1578) [`6fa7fd7`](https://github.com/cloudflare/agents/commit/6fa7fd744090f3868ae6af6b89f92b6280738504) Thanks [@threepointone](https://github.com/threepointone)! - Use path-scoped identities for newly-created sub-agents while preserving legacy bare-name identities for existing registry entries.

-   [#1578](https://github.com/cloudflare/agents/pull/1578) [`6fa7fd7`](https://github.com/cloudflare/agents/commit/6fa7fd744090f3868ae6af6b89f92b6280738504) Thanks [@threepointone](https://github.com/threepointone)! - Avoid self-deadlocking facet startup when same-name sub-agents hydrate WebSocket connection state after wake.