Repository navigation
feat: add option to disable the embedded AI Gateway - #31967
Merged
mollymaefraser merged 9 commits intoNov 11, 2026
Merged
mollymaefraser merged 9 commits into
mollymaefraser merged 9 commits into
Conversation
mollymaefraser
had a problem deploying
to
main
November 10, 2026 14:47 — with
GitHub Actions
Failure
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Collaborator
Author
|
I have read the CLA Document and I hereby sign the CLA |
cdrci2
added a commit
to coder/cla
that referenced
this pull request
Nov 10, 2026
mollymaefraser
marked this pull request as draft
November 10, 2026 15:27
SasSwart
approved these changes
Nov 11, 2026
SasSwart
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Congratulations on your first PR as part of the team! Two small nits on wording for your consideration.
SasSwart
approved these changes
Nov 11, 2026
mollymaefraser
enabled auto-merge (squash)
November 11, 2026 11:37
mollymaefraser
deleted the
molly/aigov-514-add-a-separate-switch-for-the-embedded-ai
branch
November 11, 2026 11:50
This branch was previously deployed
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.
Adds
--ai-gateway-embedded-enabled/CODER_AI_GATEWAY_EMBEDDED_ENABLED(defaulttrue) so standalone-only deployments can stopcoderdfrom starting the in-memory AI Gateway.CODER_AI_GATEWAY_ENABLEDstays the global switch: the AI Gateway entitlement,/api/v2/ai-gateway/serve, and cost-control metrics still depend only on it. The embedded daemon now starts only when both options aretrue.ENABLEDEMBEDDED_ENABLEDtruetruetruefalsefalseRefs AIGOV-514
Open questions for reviewers
chatdstill starts, but model calls fail with "AI Gateway transport factory is not configured" because there is no in-process transport. AIGOV-597 (routing Agents through standalone gateways) was canceled. The docs and option help state that Agents requires the embedded gateway. Is that acceptable, or shouldchatdalso be turned off in this mode?CODER_AI_GATEWAY_EMBEDDED_ENABLEDtentatively. OK to keep?Verification
TestServer_AIGatewayEmbeddedfails when the new check is removed.Implementation notes
codersdk/deployment.go: new option andAIBridgeConfig.EmbeddedEnabledfield; updated--ai-gateway-enableddescription.cli/server.go: outerif Enabledsets up cost-control metrics and the blocked-users collector (the standalone/serveendpoint uses these too). Innerif EmbeddedEnabledcreates the daemon, registers the in-memory handler, and adds its cleanup.cli/server_test.go:TestServer_AIGatewayEmbeddedcovers the three modes by checking for the embedded daemon's startup log.enterprise/coderd/aibridgeserve_test.go:TestAIGatewayServeEmbeddedDisabledchecks the entitlement and/servestill work with embedded disabled.docs/ai-governance/ai-gateway/standalone.md: new "Disable the embedded gateway" section.make gen.Generated with Coder Agents; reviewed, revised, and verified by @mollymaefraser.