Skip to content

fix(agents-chat-starter): spawn entities via /_electric/entities#4688

Draft
adityavkk wants to merge 1 commit into
electric-sql:mainfrom
adityavkk:fix/agents-chat-starter-spawn-endpoint
Draft

fix(agents-chat-starter): spawn entities via /_electric/entities#4688
adityavkk wants to merge 1 commit into
electric-sql:mainfrom
adityavkk:fix/agents-chat-starter-spawn-endpoint

Conversation

@adityavkk

@adityavkk adityavkk commented Jul 5, 2026

Copy link
Copy Markdown

Spawning an agent in the chat starter PUTs to ${AGENTS_URL}/${type}/${id}. Since the routing refactor in #4307, that path falls through to the durable-streams proxy on the agents-server. The proxy creates a raw stream and returns 201, so the starter's putRes.ok check passes, but no entity is created and the agent never wakes. The visible result is that rooms are created and no philosopher ever replies, with no error anywhere. Full analysis in #4687.

This changes the spawn fetch to the entity API at /_electric/entities/${type}/${id}, the same path ctx.spawn (runtime-server-client.ts), the electric-ax CLI (entity-api.ts), and the conformance DSL use. It also fixes the same snippet in the starter's AGENTS.md.

The entityUrl stored on the room and shown in the UI stays /${type}/${id}. Only the fetch URL changes.

Tested against @electric-ax/agents-server 0.6.3 with embedded streams. Before the change, the spawn PUT returns 201 and /_electric/entities stays empty. After it, the entity is created, the dispatch webhook is registered, and the first wake runs the handler.

No changeset, since the change only touches the example. #4217 is the precedent.

Fixes #4687

Since the routing refactor in electric-sql#4307, a bare PUT /:type/:id on the
agents-server falls through to the durable-streams proxy. The proxy
creates a raw stream and returns 201, so the starter's ok-check passes,
but no entity is created and the agent never wakes. Spawn through the
entity API instead, and fix the same snippet in AGENTS.md.

Fixes electric-sql#4687
@adityavkk adityavkk force-pushed the fix/agents-chat-starter-spawn-endpoint branch from 379d17d to 7f3800b Compare July 5, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agents-chat-starter: spawn PUT goes to the durable-streams proxy, so no entity is created and agents never wake

1 participant