refactor: move aibridged out of enterprise to AGPL#25570
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1cb1201 to
5d05a00
Compare
This was referenced May 21, 2026
5d05a00 to
7cef6fd
Compare
dc4e5d1 to
1183a22
Compare
ibetitsmike
approved these changes
May 21, 2026
johnstcn
approved these changes
May 21, 2026
61fe7c4 to
c51efb0
Compare
1183a22 to
0982edf
Compare
Contributor
Author
Merge activity
|
Move enterprise/aibridged and enterprise/aibridgedserver under coderd/ so the daemon can run on AGPL builds, and so chatd can route LLM traffic through aibridge without depending on enterprise code. The aibridged daemon has no enterprise-only dependencies (the only runtime touchpoint, aiseats.SeatTracker, is already exposed through the AGPL coderd.API as an interface). Moving it does not OSS any license-gated feature: the /api/v2/aibridge HTTP route stays registered only by enterprise/coderd and remains gated by RequireFeatureMW(codersdk.FeatureAIBridge). Net effect by build: - AGPL: daemon starts when CODER_AIBRIDGE_*_ENABLED; the HTTP route is never registered, so curl /api/v2/aibridge returns 404. - Unlicensed enterprise binary: daemon starts; HTTP route returns 403 via RequireFeatureMW. - Licensed enterprise: unchanged. Files moved (with import-path rewrites): - enterprise/aibridged -> coderd/aibridged - enterprise/aibridgedserver -> coderd/aibridgedserver - enterprise/coderd/aibridged.go -> coderd/aibridged.go (RegisterInMemoryAIBridgedHTTPHandler and CreateInMemoryAIBridgeServer become methods on the AGPL API) - enterprise/cli/aibridged.go -> cli/aibridged.go (buildProviders is exported as BuildProviders so enterprise/cli can still build the proxy daemon's provider list; TestDomainsFromProviders moves with the proxy to enterprise/cli/aibridgeproxyd_internal_test.go) The aibridged integration test stays enterprise-only since it uses coderdenttest; it moves to enterprise/aibridged_integration_test.go. In-place edits: - enterprise/cli/server.go drops the bridge-daemon start block and the outdated TODO about lifecycle being enterprise-owned; only the proxy daemon start remains here. cli/server.go (AGPL) now constructs the bridge daemon next to the env-seed step. - enterprise/coderd/coderd.go drops the aibridgedHandler field (now on the AGPL API) and reads it through api.AGPL.GetAIBridgedHandler. - enterprise/coderd/aibridge.go reads api.AGPL.GetAIBridgedHandler(). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c51efb0 to
a02a9bd
Compare
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.

In order to allow Coder Agents to use AI Gateway in OSS, we need to rehome the
aibridged-related code into the AGPL path.The HTTP API is only registered under enterprise so will still require the AI Governance Add-on to be present in order to use it, whereas Coder Agents uses an in-memory pipe to the same handlers.