cloudflare/agents @cloudflare/think@0.8.0
cloudflare/agents
Captured source
source ↗@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
- #1636 `f5a0d00` Thanks @threepointone! - Expose recovery incident identity and enrich the
onExhaustedpayload so
products can build a terminal-state policy without re-deriving anything (#1631).
ChatRecoveryContext(theonChatRecoveryargument) 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(theonExhaustedargument) 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), aSkillRegistrythat 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 theagents:skillsspecifier (defaulting to a./skillsdirectory), typed via ambient declarations shipped fromagents.@cloudflare/thinkre-exports the engine asskillsand wiresgetSkills()into the turn; any AI SDK caller (including@cloudflare/ai-chat) can build aSkillRegistrydirectly.
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.
- #1648 `d6827ab` Thanks @threepointone! - Surface a live "recovering…" status to chat clients during durable recovery (#1620)
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
chatRecoverydefaults, and terminal exhaustion behavior forAIChatAgentandThink. 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
retryandcontinuerecovery kinds (the incident identity no longer includes the kind), guard a throwingonExhaustedhook so the terminal UX is still delivered, mark incidentsfailedwhen 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
fiberRecoveryMaxAgeMsso a repeatedly-throwingonFiberRecovered()hook cannot re-trigger forever across restarts. - Surface Think post-persist chat request failures through
onChatError(error, ctx)andchat:request:failed. - Repair incomplete Think tool-call transcripts before provider calls and allow
createCompactFunction()to use a supplied token counter for tail budgeting.
- #1638 `b6c8dea` Thanks @threepointone! - Make chat recovery's budget wall-clock-keyed-to-progress instead of raw attempt
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/10Routine release of an early-stage agent tool.