Skip to content

refactor: centralize modelsdev.Store creation and inject via RuntimeConfig#2746

Merged
dgageot merged 1 commit into
docker:mainfrom
dgageot:board/993a7a3d523edb15
May 11, 2026
Merged

refactor: centralize modelsdev.Store creation and inject via RuntimeConfig#2746
dgageot merged 1 commit into
docker:mainfrom
dgageot:board/993a7a3d523edb15

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented May 11, 2026

Centralizes modelsdev.Store creation into a lazy RuntimeConfig.ModelsDevStore() accessor so the store is instantiated once and shared everywhere via dependency injection, replacing scattered modelsdev.NewStore() calls.

Changes

  • Add ModelsDevStore() lazy accessor to RuntimeConfig with sync.Once and ModelsDevStoreOverride for test injection
  • Thread the store through provider options (options.WithModelsDevStore) so every provider client receives it
  • Update modelcaps.Load to accept *modelsdev.Store directly; remove redundant LoadFromStore
  • Wire runtime.WithModelStore from RuntimeConfig into all runtime.New callsites (run, mcp, a2a, acp, server)
  • Convert modelsdev.NewStore from sync.OnceValues singleton to a plain function since the singleton behavior is now handled by RuntimeConfig
  • Remove per-client modelsStore fields from anthropic, bedrock, gemini, openai, and dmr providers

@dgageot dgageot requested a review from a team as a code owner May 11, 2026 13:53
@rumpl
Copy link
Copy Markdown
Member

rumpl commented May 11, 2026

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
@dgageot dgageot force-pushed the board/993a7a3d523edb15 branch from 536a555 to 2b403c8 Compare May 11, 2026 14:21
@dgageot dgageot merged commit d721117 into docker:main May 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants