Repository navigation
Replies: 2 comments
|
This was very likely a bug in the In the version you were on, sub-agent (facet) chats connect through the parent's URL ( #1443 (merged the same day you posted) fixed it by keeping the WebSocket owned by the parent agent and forwarding connect/message/close events to the child facet over RPC. It was verified by deploying this To fix it: npm i agents@latest @cloudflare/ai-chat@latestThen redeploy. If it still fails, run Also worth knowing: the example's README now recommends one top-level Durable Object per chat for apps with many long-lived chats per user, instead of facets. See |
|
This turned out to be a real deployed-only bug rather than an application configuration issue. The same problem was reproduced in #1437 and fixed in #1443. The root cause was sub-agent browser WebSockets crossing Durable Object/facet I/O ownership boundaries in deployed Workers. Local development didn’t expose the same failure mode. The fix keeps the browser WebSocket owned by the parent Agent and forwards the child agent’s connect/message/close events over RPC instead. It also included a couple of resume/stream replay fixes discovered while testing the same flow. So if anyone lands here with the same symptom, I’d first make sure you’re on a version of |
Uh oh!
There was an error while loading. Please reload this page.
If you run the Multi AI Chat example (https://github.com/cloudflare/agents/tree/main/examples/multi-ai-chat) locally, everything works just fine.
But if you deploy it and try to run it, the agent never receives messages and of course never replies.
I found this out, as we tried to mimic the same thing into our app and it worked perfectly locally but was totally broken after we deployed it. I decided to try and run the example code and saw it behaves exactly the same.
Does anyone know why? Tried to debug it with Claude for hours, but neither of us could make it work.
All reactions