Facets started via ctx.exports lack ctx.id.name, which breaks Cloudflare Agents sub-agents
dleviminzi opened ·
On Celld 0.6.0, a Durable Object facet created from a class in `ctx.exports` with an ID from `idFromName()` starts correctly. Inside the facet, however, `ctx.id.name` is `undefined`.
The Cloudflare Agents SDK 0.24 requires this name, so `subAgent()` and `agentTool()` in Agents and `@cloudflare/think` fail on Celld. The same code works on workerd.
### Versions
- **Celld:** v0.6.0, two nodes, fleet durability, S3-compatible bucket (SeaweedFS) - **agents:** 0.24.0 - **@cloudflare/think:** 0.19.0 - **Works on:** workerd via Wrangler local dev
### Reproduction
A parent Durable Object (an Agents Agent or Think agent) starts a child facet the way `subAgent()` does. The child class comes from `this.ctx.exports.<ChildClass>`, and the ID comes from `idFromName("<child-name>")`.
```js // Parent DO. Adjust to the exact facets call Agents 0.24 makes. const facet = this.ctx.facets.get("child", () => ({ class: this.ctx.exports.Child, id: this.ctx.exports.Child.idFromName("child"), // or the namespace's idFromName }));
await facet.fetch("https://facet/ping"); ```
In the child facet:
```js export class Child extends DurableObject { fetch() { return new Response(String(this.ctx.id.name)); } } ```
The child is exported from the Worker entry point, but has no binding or migration of its own, as with Agents sub-agents.
- BA
Thanks for the report. This is now fixed and will be released in the next version
bartlomiejureferenced 9ff48569e312last month on GitHub
bartlomiejureferenced f2bf648663a6last month on GitHub
ewhauserreferenced this in Merge upstream celld v0.6.1 #90last month on GitHub