Pai contrasts stateless request handlers, where an in-memory counter resets, with Durable Objects that route requests and WebSocket connections for an ID to the same persistent instance. He describes this as stateful serverless and says the model supports long-running agents, background tasks, sleep, and persistence. He cites tldraw’s synchronized drawing as an example of real-time collaboration.
Why Eval++ Is the Next Great Compute Primitive
Speakers
Cloudflare agents engineers Sunil Pai and Matt Carey discuss stateful agents, Dynamic Workers, and running LLM-generated code at an AI Engineer event.
Pai outlines the Cloudflare Agents SDK, including startup scheduling, callable methods, client hooks, and background work. A scheduled agent could gather Git history, wiki, and Notion updates each Friday and send a summary. He also says Cloudflare provides backend support for the AI SDK, including tool calls, synchronization, resumability, and cross-tab use.
Pai describes Dynamic Workers as isolated Workers that can execute code provided as a string, including code generated by an LLM. He says the sandbox starts with JavaScript without network access or APIs, then receives only the capabilities its operator grants, such as narrowly scoped fetch access. Carey frames this as revisiting eval with a fast, secure, and inexpensive execution model.
Carey says his conference talk will cover Code Mode, while Pai describes using generated code to access Cloudflare’s 2,600 API endpoints in about 1,000 tokens. Pai argues that generative interfaces could render generated HTML or React instead of generating JSON for a separate renderer, provided the code runs in a sandbox. Carey also explains that Durable Objects can make streams resumable and synchronized across tabs and browsers.
Pai sketches a coding agent on Workers with a persistent backend shared by terminal, chat, phone, and web clients. Agents could generate extensions or skills that run in a sandbox, while connecting to storage, containers, and browser tools. He says Workers support JavaScript and Python, with other languages available through WASM, and mentions a bundler that resolves npm dependencies using Cloudflare’s cache.
Takeaways
- Use a persistent, addressable runtime when an agent needs background work, resumable streams, or shared state.
- Treat generated code as an option for dynamic interfaces and workflows when you can execute it with narrowly granted capabilities.
- Plan for synchronization across clients as part of the agent backend instead of adding it later.
- Match the execution environment to the workload: Workers for lightweight code, WASM for other languages, and containers when native support is needed.
Mentioned in this talk
Search inside this talk
What was claimed 17
- works atMatt Carey works at
Cloudflare
“We work on agents at Cloudflare.”
YouTube Verified3 sources· Talk, Web· archived
- works atSunil Pai works at
Cloudflare
builds agents for the Agents SDK“We work on agents at Cloudflare.”
YouTube Verified4 sources· Talk, Web· archived
- feature
Cloudflare: Workers have no eval.
Workers have no eval.“Cloudflare's developer platform: Workers and Durable Objects”
0:15inBuilding Agents (the hard parts!)YouTube Verified3 sources· Talk
- feature
Cloudflare: Persistent, addressable objects that handle future requests and WebSocket connections for a given ID.
Persistent, addressable objects that handle future requests and WebSocket connections for a given ID.“for a given ID, you could have a class that spins up once, and then every future request and every WebSocket connection lands in the same place”
YouTube Unverified1 source· Talk
- metric
Cloudflare: About 15 milliseconds of latency in London, according to the speaker.
“in London you get about 15 milliseconds of latency”
YouTube Unverified1 source· Talk
- uses
“If you've used tldraw, it's built on this tech.”
YouTube Unverified1 source· Talk
- featureDurable Objects: Stateful serverless compute that can run in the background and provide persistence.
“They can run in the background, hibernate, go to sleep, and have persistence.”
YouTube Unverified1 source· Talk
- feature
Cloudflare: Provides React hooks and JavaScript clients, and supports background work and scheduling.
Provides React hooks and JavaScript clients, and supports background work and scheduling.“We give you React hooks ... we have plain JavaScript clients as well.”
YouTube Unverified2 sources· Talk










