agents@0.24.0
Cloudflare Agents 0.24.0 introduces a Cap'n Web transport alongside standard WebSockets, refactors durable state and background queues into modular Lifecycle capabilities, and migrates legacy tables.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
agents@0.24.0 introduces significant architectural modularization and new transport options: - WebSockets & Cap'n Web Transport : WebSockets now support the Agent protocol for plain Durable Objects. Clients can select transports via useAgent({ transport }) and AgentClient({ transport }) , offering either cf-websocket (hibernating socket default) or capnweb (direct invocation, live stubs via RpcTarget, streaming ReadableStreams, call pipelining). The experimental ?agents rpc=capnweb endpoint from v0.23.0 has been removed. - Queue Lifecycle Capability ( agents/queue ) : Durable background work now delegates to the Lifecycle job queue executed from an alarm loop. Queued callbacks run in fresh invocations and no longer access enqueuing connection context via getCurrentAgent() . Methods dequeue , dequeueAll , dequeueAllByCallback , getQueue , and getQueues are now asynchronous. QueueItem.created at is renamed to createdAt . Legacy cf agents queues and cf think workflow notifications tables are migrated on startup and will be dropped in the next minor release. - State Lifecycle Capability : State management is extracted into an opt-in State capability handling storage, validation, caching, and change ordering, usable outside of Agent . Schema versioning transitions to KV storage keys. - Protocol State Sync in WebSockets : The WebSockets capability now manages Agent protocol state synchronization and per-connection access control.
可执行摘要
agents@0.24.0 adds Cap'n Web wire transport support via useAgent and AgentClient , removes the experimental ?agents rpc=capnweb endpoint, and refactors core subsystems into Lifecycle capabilities ( Queue and State ). Queue operations are now asynchronous, queued callbacks execute via alarm loops without caller connection contexts, and legacy tables ( cf agents queues and cf think workflow notifications ) are…
- Agent 实用度
- 82/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Await previously synchronous queue methods ( dequeue , dequeueAll , dequeueAllByCallback , getQueue , getQueues ).
- Rename usages of QueueItem.created at to QueueItem.createdAt .
- Refactor any background queue callbacks that rely on getCurrentAgent() accessing the original caller's request or connection context.
- Deploy 0.24.0 before updating to future minor releases to ensure one-shot database migrations for cf agents queues and cf think workflow notifications run properly before support is removed.