fix(agents-chat-starter): spawn entities via /_electric/entities#4688
Draft
adityavkk wants to merge 1 commit into
Draft
fix(agents-chat-starter): spawn entities via /_electric/entities#4688adityavkk wants to merge 1 commit into
adityavkk wants to merge 1 commit into
Conversation
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
379d17d to
7f3800b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 returns201, so the starter'sputRes.okcheck 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 pathctx.spawn(runtime-server-client.ts), theelectric-axCLI (entity-api.ts), and the conformance DSL use. It also fixes the same snippet in the starter'sAGENTS.md.The
entityUrlstored on the room and shown in the UI stays/${type}/${id}. Only the fetch URL changes.Tested against
@electric-ax/agents-server0.6.3 with embedded streams. Before the change, the spawn PUT returns201and/_electric/entitiesstays 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