ReleaseCloudflare (Workers AI)Cloudflare (Workers AI)published Jun 2, 2026seen Jun 26

cloudflare/agents @cloudflare/think@0.8.0

cloudflare/agents

Open original ↗

Captured source

source ↗
published Jun 2, 2026seen Jun 26captured 4whttp 200method plain

@cloudflare/think@0.8.0

Repository: cloudflare/agents

Tag: @cloudflare/think@0.8.0

Published: 2026-06-02T10:03:27Z

Prerelease: no

Release notes:

Minor Changes

products can build a terminal-state policy without re-deriving anything (#1631).

  • ChatRecoveryContext (the onChatRecovery argument) now includes

recoveryRootRequestId — the stable request ID for the whole continuation chain. Unlike requestId, it doesn't change across chained continuations, so it's the right key for per-incident budget tracking / fresh-incident detection without re-deriving identity from message IDs.

  • ChatRecoveryExhaustedContext (the onExhausted argument) now carries

recoveryRootRequestId, terminalMessage (the exact text shown to the user), partialText / partialParts (what the turn produced before it was given up on), and streamId / createdAt — enough to render or persist a user-facing terminal banner AND emit correlated terminal telemetry (e.g. time-since-turn-start, stream correlation) directly, without re-deriving anything.

All fields are additive. Applied across agents (shared types), @cloudflare/think, and @cloudflare/ai-chat.

  • #1584 `87006e2` Thanks @threepointone! - Add a framework-agnostic Agent Skills engine at agents/skills: skill sources (fromManifest, R2), a SkillRegistry that produces a catalog prompt and AI SDK activation tools (activate_skill, read_skill_resource, run_skill_script), binary-safe resource reads, and qualified cross-skill resource paths. Bundled skills are imported through the Agents Vite plugin with the agents:skills specifier (defaulting to a ./skills directory), typed via ambient declarations shipped from agents. @cloudflare/think re-exports the engine as skills and wires getSkills() into the turn; any AI SDK caller (including @cloudflare/ai-chat) can build a SkillRegistry directly.

Skill loading is resilient: duplicate or failing sources are skipped with a warning (first source wins) instead of throwing. Optional, experimental script execution (skills.runner) runs function-style JavaScript/TypeScript (export default run(input, ctx) with ctx = { skill, files, workspace, tools, output }) plus path-based Python and Bash, all behind a single capability and permission bridge.

When a durable chat turn is interrupted (a deploy/eviction, or a stream-stall watchdog abort) and resumes, clients had no "in progress" signal — the turn looked frozen until it completed or a terminal error was replayed. A new cf_agent_chat_recovering protocol frame is now broadcast on recovery schedule and cleared on every terminal outcome (completed/skipped/failed/exhausted), so the indicator can't spin forever. In @cloudflare/think it's also persisted and replayed on connect, so a client that joins mid-recovery learns the turn is working. useAgentChat exposes a new isRecovering flag (distinct from isStreaming — a recovering turn isn't producing tokens yet); most UIs render isStreaming || isRecovering as "busy". Backward-compatible: clients that don't understand the frame ignore it.

> Note: @cloudflare/ai-chat broadcasts the live signal but does not yet replay > it on connect (it has no idle-connect hydration path; tracked in #1645). > @cloudflare/think has both.

For recovery telemetry, subscribe to the chat:recovery:* observability events and route them to your analytics sink.

  • #1611 `02f9380` Thanks @threepointone! - Add bounded, observable recovery foundations for durable chat turns and fibers.
  • Add dedicated recovery observability channels/events for fibers, chat recovery, transcript repair, and agent-tool recovery.
  • Bound internal framework fiber recovery hooks and parent agent-tool recovery scans so startup and recovery work cannot wedge indefinitely.
  • Add shared chat recovery incident tracking with attempt counts, configurable chatRecovery defaults, and terminal exhaustion behavior for AIChatAgent and Think. Think recovery now exhausts after six failed attempts by default and sends a terminal error frame instead of spinning indefinitely.
  • Keep the recovery attempt budget bounded even when an interrupted turn flips between retry and continue recovery kinds (the incident identity no longer includes the kind), guard a throwing onExhausted hook so the terminal UX is still delivered, mark incidents failed when the recovery dispatch throws, and reclaim incident records on success plus a TTL sweep for abandoned ones so durable storage does not grow without bound.
  • Bound generic unmanaged fiber recovery with a configurable fiberRecoveryMaxAgeMs so a repeatedly-throwing onFiberRecovered() hook cannot re-trigger forever across restarts.
  • Surface Think post-persist chat request failures through onChatError(error, ctx) and chat:request:failed.
  • Repair incomplete Think tool-call transcripts before provider calls and allow createCompactFunction() to use a supplied token counter for tail budgeting.

count, so a healthy turn under deploy churn isn't sealed prematurely...

Excerpt shown — open the source for the full document.

Notability

notability 4.0/10

Routine release of an early-stage agent tool.