chore: remove ai-gateway-cost-control experiment flag - #27579
Merged
ssncferreira merged 2 commits intoJul 29, 2026
Merged
Conversation
The AI Gateway cost control feature is now GA, so remove the ExperimentAIGatewayCostControl experiment and its gating: - Drop the experiment from codersdk/deployment.go (const, DisplayName, ExperimentsKnown). - Remove RequireExperiment gating from the AI cost control API endpoints in enterprise/coderd; these remain gated by FeatureAIBridge. - Remove experiment checks and now-obsolete negative-path tests. - Remove the experiment gate from the cost control frontend UI. - Regenerate API docs and TypeScript types.
Contributor
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
…ve-ai-gateway-cost-control-experiment-flag-once-feature # Conflicts: # docs/reference/api/schemas.md
Contributor
Documentation CheckNew Documentation Needed
Notes
Automated review via Coder Agents |
johnstcn
approved these changes
Jul 29, 2026
ssncferreira
deleted the
susana/aigov-443-remove-ai-gateway-cost-control-experiment-flag-once-feature
branch
July 29, 2026 14:00
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.
Description
Closes AIGOV-443.
The AI Gateway cost control feature has been released, so this removes the
ExperimentAIGatewayCostControlexperiment and all of its gating. The cost control API endpoints remain gated by theFeatureAIBridgelicense feature (the AI Governance add-on), so this only drops the experiment layer.Changes
codersdk/deployment.go: remove theExperimentAIGatewayCostControlconst, itsDisplayName()case, and itsExperimentsKnownentry.enterprise/coderd/coderd.go: remove thehttpmw.RequireExperiment(...)gating from the AI cost control routes. They keepRequireFeatureMW(codersdk.FeatureAIBridge). Affected endpoints:GET /organizations/{organization}/groups/ai/spendGET /organizations/{organization}/groups/{groupName}/members/ai/spendGET /organizations/{organization}/ai/spend/exportGET /groups/{group}/members/ai/spendGET /groups/{group}/ai/spendGET/PUT/DELETE /users/{user}/ai/budget/overrideandGET /users/{user}/ai/spendenterprise/coderd/aibridge_test.go: drop the experiment from test setup and remove the now-obsoleteRequiresExperimentnegative-path tests.site/src/...): remove theai-gateway-cost-controlexperiment checks from the cost control UI (Groups pages, user dropdown) and their stories/mocks. The feature is now driven solely by theaibridgefeature visibility.coderd/apidoc/*,docs/reference/api/schemas.md, andsite/src/api/typesGenerated.ts.Out of scope
The dogfood
CODER_EXPERIMENTSconfig lives in a separate infra repo, notcoder/coder. Leavingai-gateway-cost-controlthere is harmless: unknown experiment values are logged as"ignoring unknown experiment"at startup and otherwise ignored, so no ordering dependency or breakage. That cleanup can be a follow-up.Implementation notes
coderd/coderd.goReadExperiments: unknown values produce a warning log and are inert, so removing the definition before the dogfood config is updated is safe.ai/budgetroutes (/groups/{group}/ai/budget) were already gated only byFeatureAIBridge, never by the experiment. After this change all cost control routes are uniformly feature-gated, resolving that inconsistency.RequiresExperimentsubtest inTestUserAISpendStatusthat only asserted a 403 from the experiment gate; with the gate gone it would no longer be blocked pre-RBAC.This PR was created by Coder Agents on behalf of @ssncferreira.