feat: synchronise provider changes with WatchAIProviders - #27091
Merged
Conversation
Cherry-pick of #26797, which was accidentally merged into the stale graphite-base/26797 branch instead of main and so never landed. Conflicts with current main are resolved in the following commit to keep this commit a faithful copy of the original PR. Adds a WatchAIProviders streaming RPC to the ProviderConfigurator service so a running standalone AI Gateway refetches its provider set when the provider configuration changes. The server subscribes to AIProvidersChangedChannel (published by the provider CRUD endpoints) and forwards each event as a payload-free signal, plus one signal on subscribe; the gateway calls GetAIProviders on each signal to rebuild its pool. The aibridged API is bumped to v1.2. Refs https://linear.app/codercom/issue/AIGOV-465
Isolated from the preceding cherry-pick commit so reviewers can see exactly what changed when re-landing #26797 on current main: - coderd/aibridged/proto/aibridged.pb.go: regenerated via the proto make target (the cherry-picked copy was generated against the older proto). - enterprise/cli/aigatewaystart.go: union the import block; main added os and strings while the PR added sync. - coderd/aibridgedserver/aibridgedserver_test.go: three NewServer call sites that landed on main after the branch diverged now pass the new pubsub argument.
dannykopping
force-pushed
the
danny/aigov-465-provider-reload-cherrypick
branch
from
July 8, 2026 12:16
8e0a199 to
e6ac616
Compare
pawbana
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #26797 was accidentally merged into the stale
graphite-base/26797branch instead ofmain(Graphite picked the wrong base), so its changes never landed onmain. This PR re-lands that work as a clean cherry-pick onto the currentmain.What
Adds a
WatchAIProvidersstreaming RPC to theProviderConfiguratorservice so a running standalone AI Gateway refetches its provider set when the provider configuration changes. The server subscribes toAIProvidersChangedChannel(published by the provider CRUD endpoints) and forwards each event as a payload-free signal, plus one signal on subscribe; the gateway callsGetAIProviderson each signal to rebuild its pool. The aibridged API is bumped to v1.2.Env-seeded providers don't need a signal: seeding finishes before coderd serves the gateway connection, so the gateway's initial fetch already reflects the seeded set.
For reviewers
The change is split into two commits to make review easy:
feat: synchronise provider changes with WatchAIProvidersis a faithful cherry-pick of feat: synchronise provider changes withWatchAIProviders#26797, identical to the originally reviewed PR. It is committed without pre-commit hooks because it does not build against currentmainon its own.fix: resolve cherry-pick conflicts against maincontains only the deltas needed to re-land on currentmain, and passes the full pre-commit suite:coderd/aibridged/proto/aibridged.pb.goregenerated via the proto make target (the cherry-picked copy was generated against the older proto).enterprise/cli/aigatewaystart.goimport block unioned;mainaddedosandstringswhile the PR addedsync.aibridgedserver.NewServertest call sites that landed onmainafter the original branch diverged now pass the newpubsubargument.Refs https://linear.app/codercom/issue/AIGOV-465
This PR was produced by opencode (agent) using the
anthropic/claude-opus-4-8model, under human direction and review.