electric-ax agents CLI reports "No entity types found" for freshly-registered types (default Electric-Principal has no visibility)
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- authorization, cli
調査の方向性
packages/electric-ax の getElectricCliEnv から始め、agents がどのようにコマンドを読み取るかを追跡します。そこには、principal headers を構築する agents types も含まれます。Issue に示されている 2 つの Electric-Principal 値を使って、空のレスポンスと値が入ったレスポンスを再現し、そのうえで意図されたローカル動作、または権限をより明確に考慮した出力を選択して実装します。新しく登録した型が walkthrough コマンドから発見できるか、または表示されない理由を CLI が明確に説明できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
After following the agents walkthrough and registering an entity type, electric-ax agents types prints No entity types found, even though the type is registered and visible in the dev UI. The same mismatch affects other agents read commands. The cause is that the CLI sends a default Electric-Principal that the server has no visibility grants for.
Steps to reproduce
- Follow the agents walkthrough so an
assistant(or any) entity type is registered against a local server athttp://localhost:4437. - Confirm it registered — the dev UI at
https://localhost:4438lists it, and:curl -s http://localhost:4437/_electric/entity-types | jq '.[].name' # => "assistant", "principal" - Run the CLI:
pnpx electric-ax@latest agents types # => No entity types found
Expected
Immediately after registering a type and following the walkthrough, agents types lists it.
Actual
No entity types found, which reads as "registration failed" and sends you debugging the wrong thing.
Root cause
GET /_electric/entity-types is scoped by the Electric-Principal request header:
- No header (plain
curl) → returns everything (assistant,principal). Electric-Principal: system:dev-local(what the dev UI uses) → returns the registered types.Electric-Principal: user:<whoami>@<hostname>→ returns[].
getElectricCliEnv defaults the principal to user:${ELECTRIC_AGENTS_IDENTITY} where the identity is ${os.userInfo().username}@${os.hostname()} (packages/electric-ax). That principal has no grants for the walkthrough-registered types, so the server correctly returns an empty list — and the CLI prints No entity types found.
Demonstration:
# empty (CLI default principal)
curl -s -H "Electric-Principal: user:$(whoami)@$(hostname)" \
http://localhost:4437/_electric/entity-types | jq length # => 0
# populated (dev UI principal)
curl -s -H "Electric-Principal: system:dev-local" \
http://localhost:4437/_electric/entity-types | jq 'map(.name)' # => ["assistant","principal"]
Workaround
ELECTRIC_AGENTS_PRINCIPAL=system:dev-local electric-ax agents types
Why this is confusing / suggested fixes
The inconsistency is that an unauthenticated request sees all types while the CLI's "authenticated" default sees none, and the walkthrough implies the plain agents types command lists what you just registered. Some options:
- Have the local dev flow default the CLI to the same principal the dev server/UI uses (
system:dev-local), or grant the defaultuser:<identity>principal visibility of types it can spawn. - If empty-because-of-permissions is intended, distinguish it in the CLI output (e.g.
No entity types visible to principal <p>with a hint aboutELECTRIC_AGENTS_PRINCIPAL) instead of the flatNo entity types found. - At minimum, document the principal scoping in the walkthrough next to the
agents typesstep.
Environment
electric-axCLI0.2.23(and@latest), agents server image0.6.3,@electric-ax/agents-runtime0.6.3.- macOS, local Docker dev stack (
electric-ax agents start).
- 主要言語
- 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 件 ·
-
agents-chat-starter: spawn PUT goes to the durable-streams proxy, so no entity is created and agents never wake対応中かも @adityavkk が 133 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
electric-sql/electric#4687 ·
-
Listen IP addressオープンfeature request triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
electric-sql/electric#4150 · コメント 1 件 ·
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 ·