mirror of
https://github.com/coder/coder.git
synced 2026-09-22 21:22:17 +08:00
chatd subscribes to `ChatConfigEventChannel` and invalidates its provider cache on a `providers` event kind, but nothing ever published that kind. AI provider CRUD only publishes on `AIProvidersChangedChannel` (consumed by aibridged and aibridgeproxyd), so chatd's provider cache only converged via its 10 second TTL. Subscribe chatd to the same `AIProvidersChangedChannel` publish instead of adding a second publish, per the review feedback on #26207: one publish, multiple subscribers. The now-unused `ChatConfigEventProviders` kind is removed so `ChatConfigEvent` stays scoped to model configs, user prompts, and advisor config, and can't regrow a dead subscriber. Follow-up to CRF-5 from the review of #25673. Supersedes #26207. Closes CODAGT-499
12 lines
528 B
Go
12 lines
528 B
Go
package pubsub
|
|
|
|
// AIProvidersChangedChannel is the pubsub channel that carries AI
|
|
// provider lifecycle events: provider create / update / soft-delete
|
|
// and key insert / delete. Subscribers (aibridged, aibridgeproxyd,
|
|
// chatd) reload their in-memory provider snapshot on receipt.
|
|
//
|
|
// The payload is an empty invalidation hint; subscribers refetch the
|
|
// authoritative state from the database, so dropped messages only
|
|
// delay convergence rather than diverge state.
|
|
const AIProvidersChangedChannel = "ai_providers_changed"
|