First-class multi-tenant runtime for per-connection bots
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
まず github.com/delphi-ai/multi-tenant-chat のリファレンス実装を読み、SDK の webhook および Chat runtime のエントリーポイントと比較します。webhook ごとに接続が解決され、runtime が認証情報と状態を分離し、handler が接続コンテキストを受け取り、LRU eviction がテストでカバーされれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem Statement
The Chat SDK assumes one bot identity and one credential set per process. In a SaaS product, each customer connects their own Telegram bot, SMS number, or WhatsApp sender. We need many isolated bot runtimes on shared webhook routes without running one process per connection.
Proposed Solution
Add a built-in multi-tenant mode (or official helper) that:
- Resolves a connection from platform + connectionKey on each webhook
- Lazily creates a Chat instance per connection with its own adapter credentials
- Prefixes shared state keys so thread/subscription state does not collide
- Exposes connection context in message handlers (e.g. via AsyncLocalStorage)
- Caches runtimes with LRU eviction
Handlers would receive (ctx, thread, message) where ctx.connection identifies the tenant.
Alternatives Considered
- One global Chat and swap credentials per request: not safe for concurrent webhooks
- One Chat singleton per connection: too much memory at scale
- External wrapper package: works today, but belongs in the SDK long term
We ship option 3 as @delphi-ai/multi-tenant-chat until upstream support exists.
Use Case
Priority
Critical
Contribution
- I am willing to help implement this feature
Additional Context
We already built and use this pattern. Reference implementation: https://github.com/delphi-ai/multi-tenant-chat.
- 主要言語
- TypeScript
- スター
- 2.5k
- フォーク
- 355
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 42
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel/chat のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
X and Twitch: paragraphs inside a block quote are joined with no space対応中かも @abhiramshaji-cyber が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
db-ux-design-system/core-web#8856 ·
メンテナーはふだん 1 日以内に返信
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footer対応中かも @wittdennis が今日担当しました。 オープンpriority: p3 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
googleapis/release-please#2971 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
🛠️ dette technique
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
betagouv/mon-entreprise#4752 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信