refactor(coderd): store bedrock model resolution in provider settings - #29175
Merged
evgeniy-scherbina merged 1 commit intoSep 10, 2026
Conversation
evgeniy-scherbina
marked this pull request as ready for review
September 10, 2026 15:21
evgeniy-scherbina
requested review from
ibetitsmike and
johnstcn
as code owners
September 10, 2026 15:21
evgeniy-scherbina
merged commit Sep 10, 2026
e68042a
into
yevhenii/aigov-488-resolve-inference-profiles-at-write-time
48 of 56 checks passed
evgeniy-scherbina
deleted the
yevhenii/aigov-488-store-resolution-in-settings
branch
September 10, 2026 15:22
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #29112, which stores the resolved Bedrock model in its own table. Keyed by inference profile ARN, that table needed a migration, three queries, dbauthz wrappers, a store-interface method, and a join in the provider payload. This PR keeps the values in the settings blob instead, where the rest of the provider's Bedrock configuration already lives.
The plumbing that disappears is the point:
aibridgedserverno longer collects identifiers, queries mappings, or threads a map throughaiProviderToProto; it reads two fields off the settings it already decoded. Net 314 deletions against 119 insertions, and no schema change.Resolution still runs after the write commits, so no AWS call happens inside a transaction, and still runs on every save. Storing the result now means a second
UpdateAIProviderwith the resolved settings, which is the one thing the table did not need.Server ownership is enforced by clearing rather than validating. The write path zeroes
resolved_modelandresolved_small_fast_modelbefore storing and rewrites them after resolution, so a client-supplied value is discarded rather than rejected, and a stale value cannot survive a settings change. That is one two-line helper instead of the validation, merge carry-forward, and compare-before-write that an earlier attempt at this needed.What is lost relative to the table: two providers configured with the same ARN each store their own copy, and each resolves it separately. Resolution already ran per save, so this costs storage rather than AWS calls.
Behavior is unchanged. An unresolved ARN still serves as its own identity, a failed lookup still reports 400 while leaving the provider stored, and the gateway still never calls the Bedrock control plane.
Relates to https://linear.app/codercom/issue/AIGOV-488
Created by Coder Agents on behalf of @evgeniy-scherbina.