refactor: centralize modelsdev.Store creation and inject via RuntimeConfig#2746
Merged
Conversation
Member
|
lol conflicts |
Rebase PR docker#2746 on top of origin/main, resolving conflicts with PR docker#2738. Key changes: - Add RuntimeConfig.ModelsDevStore() lazy accessor with sync.Once caching - Add options.WithModelsDevStore to thread the store through provider options - Merge modelcaps.Load and LoadFromStore into a single Load(store, modelID) - Remove per-client modelsStore fields from all provider clients (anthropic, openai, gemini, bedrock, dmr) — they now get the store via ModelOptions - Convert modelsdev.NewStore from sync.OnceValues singleton to a plain function since RuntimeConfig handles the caching - Wire RuntimeConfig.ModelsDevStore through teamloader, cmd/root/models, and rag/strategy/embedding - Update detectCachingSupport (bedrock) to accept store parameter - Rename oaistream ConvertMessagesFromStore/ConvertMultiContentFromStore to ConvertMessages/ConvertMultiContent - Keep c.ID() (qualified provider/model) from PR docker#2738 at all call sites
536a555 to
2b403c8
Compare
rumpl
approved these changes
May 11, 2026
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.
Centralizes
modelsdev.Storecreation into a lazyRuntimeConfig.ModelsDevStore()accessor so the store is instantiated once and shared everywhere via dependency injection, replacing scatteredmodelsdev.NewStore()calls.Changes
ModelsDevStore()lazy accessor toRuntimeConfigwithsync.OnceandModelsDevStoreOverridefor test injectionoptions.WithModelsDevStore) so every provider client receives itmodelcaps.Loadto accept*modelsdev.Storedirectly; remove redundantLoadFromStoreruntime.WithModelStorefromRuntimeConfiginto allruntime.Newcallsites (run, mcp, a2a, acp, server)modelsdev.NewStorefromsync.OnceValuessingleton to a plain function since the singleton behavior is now handled byRuntimeConfigmodelsStorefields from anthropic, bedrock, gemini, openai, and dmr providers