agents-0-22-0-9-b
Claude Code's read-only tools, web search on, ludion sync off
Question
What base class does Agent extend in the Cloudflare Agents SDK?
Answer key
- A correct answer says
- `Agent` extends Cloudflare's `DurableObject` directly, with the needed PartyServer runtime vendored into `agents/lifecycle`.
- The stale answer
- `Agent` extends PartyServer's `Server` class.
Answer
In the Cloudflare Agents SDK (the `agents` package), `Agent` extends `Server` from the `partyserver` library. `Server` is in turn built on Cloudflare's `DurableObject` class. So every Agent is a Durable Object underneath. That is where it gets its persistent state, its embedded SQLite storage, WebSocket handling and scheduling.
I answered this from memory and didn't check the current source. The SDK changes quickly, so it's worth confirming in the latest `agents` package if you need it to be exact.Grade
wrong
The judge's reason: It states the stale fact that Agent extends PartyServer's Server class rather than extending DurableObject directly.
Session log
Agent
In the Cloudflare Agents SDK (the `agents` package), `Agent` extends `Server` from the `partyserver` library. `Server` is in turn built on Cloudflare's `DurableObject` class. So every Agent is a Durable Object underneath. That is where it gets its persistent state, its embedded SQLite storage, WebSocket handling and scheduling. I answered this from memory and didn't check the current source. The SDK changes quickly, so it's worth confirming in the latest `agents` package if you need it to be exact.