feat: model-level provider priority lists with runtime fallback#23649
Closed
ibetitsmike wants to merge 25 commits into
Closed
feat: model-level provider priority lists with runtime fallback#23649ibetitsmike wants to merge 25 commits into
ibetitsmike wants to merge 25 commits into
Conversation
Collaborator
Author
|
@codex review |
Contributor
Documentation CheckUpdates Needed
Automated review via Coder Tasks |
Collaborator
Author
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08f847d066
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2821e52 to
a475e54
Compare
f3ff651 to
185fe71
Compare
e44bf71 to
ceb2d46
Compare
1628633 to
c4adf90
Compare
5912186 to
dcbf8bc
Compare
185fe71 to
a492f04
Compare
0aa113b to
bee4901
Compare
cc30959 to
a3e75e4
Compare
bee4901 to
31b937e
Compare
…explicit attachments
… chat model config requests
…e provider attachments
…edupe Stage 2 story fixtures
…xtract shared provider label helper
…edupe story fixtures
…fy model config form tests
…educe admin panel LOC
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.
Summary
Builds on #23647 (Stage 1). Adds model-level provider config priority lists so each model can reference multiple provider configs from the same provider family in fallback order. Disabled/unusable configs are skipped at selection time.
Enforces mandatory explicit attachments (Design A): every chat model must be bound to at least one provider config. Models without attachments are hidden from users and rejected at runtime.
Database
chat_model_provider_configsjoin table withmodel_config_id,provider_config_id,priority, timestamps, and proper constraints/indexes.ROW_NUMBER()for safe multi-row handling).API
ChatModelConfigresponse now includesprovider_configs(ordered attachments with provider metadata, enabled/has_api_key status).CreateChatModelConfigRequestrequiresprovider_config_ids(ordered list). Requests without at least one ID are rejected with HTTP 400.UpdateChatModelConfigRequestacceptsprovider_config_ids(null= unchanged, non-null = full replacement).reconcileChatModelProviderConfigsAfterProviderDelete, which re-indexes remaining attachments or soft-deletes models that lose all attachments.Runtime
resolveChatModelwalks ordered provider attachments instead of merging by provider family name.Cache
ModelAttachments(ctx, modelID)provides cached attachment lookups viatlruandsingleflight.modelAttachmentEpoch,modelTopologyEpoch) prevents stale singleflight fetches from overwriting newer user updates.Frontend
Tests
ProviderConfigIDValidationtable-driven cases.TestResolveChatModel.