Skip to content

fix: pass Models map to RAG ManagersBuildConfig for model alias resolution#2324

Open
dgageot wants to merge 1 commit intodocker:mainfrom
dgageot:board/rag-tool-missing-models-map-in-build-con-811e288b
Open

fix: pass Models map to RAG ManagersBuildConfig for model alias resolution#2324
dgageot wants to merge 1 commit intodocker:mainfrom
dgageot:board/rag-tool-missing-models-map-in-build-con-811e288b

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 4, 2026

Problem

createRAGTool in pkg/teamloader/registry.go builds rag.ManagersBuildConfig without populating the Models field. This means any RAG config using a model alias for reranking (e.g. model: balanced referencing a named model from the top-level models: section) fails at runtime with:

toolset rag failed: failed to create RAG manager: failed to build manager
config for RAG "rag": failed to build reranking config: failed to resolve
reranking model "balanced": model "balanced" not found in configuration

Fix

  • Add Models field to config.Config
  • Populate runConfig.Models from cfg.Models in teamloader before agent loading
  • Pass runConfig.Models through to ManagersBuildConfig in createRAGTool
  • Clone Models map in RuntimeConfig.Clone() to prevent shared mutable state
  • Add tests for Models cloning isolation

…ution

createRAGTool was not passing the Models map to rag.ManagersBuildConfig,
causing RAG configs using model aliases for reranking to fail with
'model not found in configuration'.

- Add Models field to config.Config
- Populate runConfig.Models from cfg.Models in teamloader
- Pass runConfig.Models through to ManagersBuildConfig in createRAGTool
- Clone Models map in RuntimeConfig.Clone() to prevent shared state

Assisted-By: docker-agent
@dgageot dgageot requested a review from a team as a code owner April 4, 2026 17:52
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