agents-0-22-0-9-b
Claude Code's read-only tools, web search on, ludion sync on
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 installed version (agents 0.27.0), `Agent` extends Cloudflare's `DurableObject<Env>` directly. I confirmed this in the package's type declarations (`node_modules/agents/dist/agent-routing-Bhdbvf7s.d.ts:4521`). Before 0.22.0, `Agent` extended `Server` from `partyserver`, which in turn extended `DurableObject`. That PartyServer runtime is now bundled inside the package under `agents/lifecycle`, so `Agent` is still a Durable Object but no longer sits on top of a `partyserver` class.Grade
correct
The judge's reason: It states Agent extends DurableObject directly with PartyServer runtime bundled under agents/lifecycle, mentioning Server only as past behavior.
Session log
Tool call: Grep
{ "pattern": "class Agent\\b.*extends", "path": "C:\\Users\\haya0\\AppData\\Local\\Temp\\ludion-bench-nBQNMO\\work\\node_modules\\agents\\dist", "glob": "*.d.ts", "output_mode": "content" }Tool output
No matches foundTool call: Grep
{ "pattern": "class Agent<", "path": "C:\\Users\\haya0\\AppData\\Local\\Temp\\ludion-bench-nBQNMO\\work\\node_modules\\agents", "output_mode": "content", "head_limit": 5 }Tool output
node_modules\agents\dist\agent-routing-Bhdbvf7s.d.ts:4517:declare class Agent< node_modules\agents\dist\src-DgCbZtIR.js.map:1:[Omitted long matching line]Tool call: Read
{ "file_path": "C:\\Users\\haya0\\AppData\\Local\\Temp\\ludion-bench-nBQNMO\\work\\node_modules\\agents\\dist\\agent-routing-Bhdbvf7s.d.ts", "offset": 4517, "limit": 8 }Tool output
4517 declare class Agent< 4518 Env extends Cloudflare.Env = Cloudflare.Env, 4519 TState = unknown, 4520 Props extends object = object 4521 > extends DurableObject<Env> { 4522 /** 4523 * Runtime lifecycle and reusable durable capabilities for this Agent. 4524 *Agent
In the installed version (agents 0.27.0), `Agent` extends Cloudflare's `DurableObject<Env>` directly. I confirmed this in the package's type declarations (`node_modules/agents/dist/agent-routing-Bhdbvf7s.d.ts:4521`). Before 0.22.0, `Agent` extended `Server` from `partyserver`, which in turn extended `DurableObject`. That PartyServer runtime is now bundled inside the package under `agents/lifecycle`, so `Agent` is still a Durable Object but no longer sits on top of a `partyserver` class.