warehouse: the connection registry is process-global, so one server hands the first project's connections to every project
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/opencode/src/altimate/native/connections/registry.ts から始め、Instance.provide() が configs、保留中のロード、ロード済み状態、connector のキャッシュにディレクトリコンテキストをどのように渡しているかを追跡します。2 プロジェクトの再現手順をもう一度実行し、その後 cli/cmd/run.ts:408 と server/server.ts:281 の attach-without-dir パスを調べます。リクエストでネストされたディレクトリを使用する場合も含め、別々のプロジェクトが configs やアクティブな connector を共有しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
ConnectionRegistry keeps configs, connectors, pending, and loaded as module-level state (packages/opencode/src/altimate/native/connections/registry.ts). ensureLoaded() loads once for the life of the process. One server process serving two projects therefore hands the first project's connections to both.
Reproduced with two Instance.provide() contexts against the same process:
first: Instance.directory = .../project-a → path = .../project-a/warehouse.db
second: Instance.directory = .../project-b → path = .../project-a/warehouse.db
Cached connectors make it worse: they are keyed only by connection name, so project B can be handed a live connector already open against project A's warehouse.
Why it matters now
This predates #1204 — before it, the base was the server's launch directory for everyone, so every project was equally wrong. #1204 made resolution correct for whichever project loads first, which is the right answer for the single-project case that covers nearly all real use. The residue is that the behaviour is now "first request wins" rather than "uniformly wrong", and that is worth closing properly rather than leaving in a comment.
Two related gaps in the same area:
Instance.directoryis the request's working directory, notInstance.worktree. A request naming a nested directory looks for.altimate-codein that nested directory rather than at the project root.run --attachwithout--dirsends no directory (cli/cmd/run.ts:408), so the server falls back to its own cwd (server/server.ts:281).
What a fix looks like
Make the registry state instance-scoped rather than module-scoped — keyed by Instance.directory, or held in the instance context — so each project loads and caches its own configs and connectors. Connector cache keys need the project in them too.
Not a blocker for #1204
#1204 documents this limitation in projectRoot()'s doc comment and does not regress it. Filing separately because the fix is a state-ownership change across the whole registry, not a path-resolution change.
- 主要言語
- TypeScript
- スター
- 813
- フォーク
- 134
- 平均マージ
- 2日 8分
- マージ済み PR(30日)
- 65
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AltimateAI/altimate-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
AltimateAI/altimate-code#1359 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AltimateAI/altimate-code#1323 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
AltimateAI/altimate-code#1288 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
AltimateAI/altimate-code#1285 ·
メンテナーはふだん 1 日以内に返信
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifierオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
AltimateAI/altimate-code#1284 ·
メンテナーはふだん 1 日以内に返信
AltimateAI/altimate-code の issue をすべて見る
似ている issue
-
docs
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
remix-run/react-router#15558 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solana-foundation/pay-kit#341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
supabase/agent-skills#607 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信