agents-chat-starter: spawn PUT goes to the durable-streams proxy, so no entity is created and agents never wake
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
examples/agents-chat-starter/src/server/index.ts の spawn fetch と、starter の AGENTS.md にある Entity Bootstrap スニペットから始めます。それらのリクエストパスを packages/agents-server/src/routing/entities-router.ts の entity route と比較し、その後 Quick Start を実行して、entity が /_electric/entities に表示され、メッセージ後に agent が起動することを確認します。
索引モデルが issue の本文から書いたものです。
説明
What happens
Follow the starter's Quick Start, create a room, and send a message. No philosopher ever replies. Nothing reports an error. POST /api/rooms returns {"agentCount": 1} and the spawn PUT returns 201 Created.
The spawn call in examples/agents-chat-starter/src/server/index.ts PUTs to the bare entity path:
const entityUrl = `/${type}/${agentId}`
const putRes = await fetch(`${AGENTS_URL}${entityUrl}`, { method: `PUT`, ... })
On the current agents-server, that path never reaches the entity API. packages/agents-server/src/routing/global-router.ts sends /_electric/* to the internal router and everything else to the durable-streams proxy:
globalRouter.all(`/_electric/*`, internalRouter.fetch)
globalRouter.all(`*`, durableStreamsRouter.fetch)
So the PUT creates a raw durable stream named /socrates/<id> and returns 201. No entity is created, no dispatch subscription is registered, and the agent never wakes. The only route that creates an entity is PUT /_electric/entities/:type/:instanceId (packages/agents-server/src/routing/entities-router.ts).
Repro
Against @electric-ax/agents-server 0.6.3 (run via pnpm dlx, embedded streams, port 4510) with the starter's backend running so the socrates/camus/simone types are registered:
$ curl -s -o /dev/null -w '%{http_code}\n' -X PUT localhost:4510/socrates/repro-bare \
-H 'content-type: application/json' \
-d '{"args":{"chatroomId":"repro"},"initialMessage":"You have joined."}'
201
$ curl -s localhost:4510/_electric/entities
# only the principal entity; /socrates/repro-bare is not there
$ curl -s -X PUT localhost:4510/_electric/entities/socrates/repro-entity \
-H 'content-type: application/json' \
-d '{"args":{"chatroomId":"repro"},"initialMessage":"You have joined."}'
{"url":"/socrates/repro-entity","type":"socrates","status":"idle","streams":{"main":"/socrates/repro-entity/main"},"dispatch_policy":{"targets":[{"url":"http://localhost:4710/webhook","type":"webhook",...
After the second PUT the entity appears in /_electric/entities, the dispatch webhook is registered, and the first wake runs the handler. Nothing at all happens after the first PUT.
Why it broke
The starter was correct when it was written. At the original Electric Agents commit (#4151), the server matched bare /{type}/{name} paths and spawned on PUT. The routing refactor in #4307 moved entity creation under /_electric/entities and pointed the catch-all at the durable-streams proxy. The starter (added in #4199, before the refactor) kept the old path, so it has been silently broken since #4307. The failure mode is nasty because the proxy answers 201 and the starter's putRes.ok check passes.
Everything else in the repo already uses the canonical path: ctx.spawn through runtime-server-client.ts spawnEntity(), the electric-ax CLI (entity-api.ts), and the conformance DSL, which prefixes /_electric/entities onto every entity request.
Fix
Point the starter's spawn fetch at ${AGENTS_URL}/_electric/entities/${type}/${id}, and fix the same snippet in the starter's AGENTS.md ("Entity Bootstrap" section). PR incoming.
Versions: @electric-ax/agents-server 0.6.3, @electric-ax/agents-runtime 0.6.3, repo main at 9e3af10c3.
A separate, smaller problem found on the way: pnpm install on a freshly scaffolded copy (npx electric-ax agents init) fails because the template's package.json pins "@electric-ax/agents-runtime": "workspace:*", which does not resolve outside the monorepo. Happy to file that separately.
- 主要言語
- TypeScript
- スター
- 10.4k
- フォーク
- 399
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
electric-sql/electric のほかの issue
-
camelToSnake and snakeCamelMapper() drop the underscore when a digit precedes a camelCase boundaryオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
electric-sql/electric#4855 ·
-
ShapeStream does not notify subscribers when it gives up on a non-Error value対応中かも @Tyagiquamar が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
electric-sql/electric#4830 ·
-
@electric-sql/client throws SecurityError on import when the browser blocks site storage (typeof localStorage outside try)対応中かも @mohanedmoh が 37 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
electric-sql/electric#4826 · コメント 1 件 ·
-
Listen IP addressオープンfeature request triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
electric-sql/electric#4150 · コメント 1 件 ·
-
ArrayDecoder doesn't handle escaped backslashes in quoted PostgreSQL array elements対応中かも @cpruijsen が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
electric-sql/electric#3708 ·
electric-sql/electric の issue をすべて見る
似ている issue
-
Bug: Broken RTL / BiDi text rendering when mixing Persian (Farsi) with English or numbers対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 半日 初心者へのやさしさ 68/100
amosblomqvist/learnharness#758 ·
メンテナーはふだん 2 日以内に返信
-
Change Workspacesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
bitfocus/companion-module-renewedvision-propresenter-api#134 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
rcpch/digital-growth-charts-react-component-library#304 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dsh-market/dsh-market#1210 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
trustjonathan/STUDY-HUB#13 ·