🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat: synchronise provider changes with WatchAIProviders - #27091

Merged
dannykopping merged 2 commits into
mainfrom
danny/aigov-465-provider-reload-cherrypick
Jul 8, 2026
Merged

feat: synchronise provider changes with WatchAIProviders#27091
dannykopping merged 2 commits into
mainfrom
danny/aigov-465-provider-reload-cherrypick

Conversation

@dannykopping

@dannykopping dannykopping commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Why

PR #26797 was accidentally merged into the stale graphite-base/26797 branch instead of main (Graphite picked the wrong base), so its changes never landed on main. This PR re-lands that work as a clean cherry-pick onto the current main.

What

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.

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:

  1. feat: synchronise provider changes with WatchAIProviders is a faithful cherry-pick of feat: synchronise provider changes with WatchAIProviders #26797, identical to the originally reviewed PR. It is committed without pre-commit hooks because it does not build against current main on its own.
  2. fix: resolve cherry-pick conflicts against main contains only the deltas needed to re-land on current main, and passes the full pre-commit suite:
    • 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 import block unioned; main added os and strings while the PR added sync.
    • Three aibridgedserver.NewServer test call sites that landed on main after the original branch diverged now pass the new pubsub argument.

Refs https://linear.app/codercom/issue/AIGOV-465

This PR was produced by opencode (agent) using the anthropic/claude-opus-4-8 model, under human direction and review.

@dannykopping
dannykopping requested a review from pawbana July 8, 2026 12:09
@linear-code

linear-code Bot commented Jul 8, 2026

Copy link
Copy Markdown

AIGOV-465

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
dannykopping force-pushed the danny/aigov-465-provider-reload-cherrypick branch from 8e0a199 to e6ac616 Compare July 8, 2026 12:16
@dannykopping
dannykopping merged commit affb359 into main Jul 8, 2026
32 of 33 checks passed
@dannykopping
dannykopping deleted the danny/aigov-465-provider-reload-cherrypick branch July 8, 2026 13:32
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants