Repository navigation
feat(coderd/database): add organization AI model config table - #30717
Merged
Merged
Conversation
This was referenced Oct 13, 2026
SasSwart
force-pushed
the
sdlcgraph/aigov-612-2-schema
branch
from
October 14, 2026 12:42
846c493 to
a4905b5
Compare
SasSwart
commented
Oct 15, 2026
SasSwart
marked this pull request as ready for review
October 15, 2026 07:21
SasSwart
force-pushed
the
sdlcgraph/aigov-612-2-schema
branch
from
October 15, 2026 11:12
637482c to
cb64491
Compare
SasSwart
commented
Oct 15, 2026
SasSwart
force-pushed
the
sdlcgraph/aigov-612-2-schema
branch
from
October 16, 2026 10:22
cb64491 to
b2f850f
Compare
SasSwart
force-pushed
the
sdlcgraph/aigov-612-2-schema
branch
from
October 19, 2026 08:56
b2f850f to
1ccb8d9
Compare
Base automatically changed from
sdlcgraph/aigov-612-1-price-validation
to
main
October 19, 2026 09:12
SasSwart
force-pushed
the
sdlcgraph/aigov-612-2-schema
branch
from
October 19, 2026 09:12
1ccb8d9 to
3cd08f7
Compare
mtojek
approved these changes
Oct 19, 2026
Organization prices are only per configured provider. Site-wide prices per provider type stay in ai_model_prices.
Drop the ai_model_price_kind enum and the price_* columns on aibridge_token_usages until the design is settled.
… config Rename ai_org_provider_model_prices to ai_model_configs, so the table can hold other per-model AI Governance settings next to token prices. The organization stays a column, as in other organization-scoped tables. Reject an empty model with a check constraint.
…to 000630 Main already uses 000623 through 000629.
Add a deleted flag to ai_model_configs. A surrogate id becomes the primary key, and a partial unique index keeps one live row per organization, provider and model, so a soft-deleted row does not block a new one for the same model.
SasSwart
force-pushed
the
sdlcgraph/aigov-612-2-schema
branch
from
October 21, 2026 05:39
5db6ac8 to
6a6460c
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.
Adds
ai_model_configs: an organization's AI Governance configuration for one model on one configured provider. Token prices are its first settings. Migration000630is additive and needs no backfill.deletedflag. A surrogateidis the primary key, and a partial unique index allows one live row per(organization_id, provider_id, model). Cascades on delete of the organization or provider. The organization is a column, as in other organization-scoped tables.openai-compatgateways be priced, and lets providers of the same type have different prices.ai_model_pricestable, unchanged.Recording which price was used on each token usage record is deferred until its design settles.
Used later: #30718 adds the queries that read and write the table, and #30719 looks prices up from it. The rest of the diff is generated.
This PR was generated by Coder Agents on behalf of @SasSwart.