Fix LLM/MCP Configuration not rehydrated after DB reload
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Description
When LLM Provider, LLM Proxy, or MCP configurations are loaded from the database (e.g., after controller restart), unmarshalSourceConfig in sql_store.go only populates SourceConfiguration, leaving Configuration as a zero-value api.APIConfiguration. Multiple code paths depend on Configuration.Spec.AsAPIConfigData() and break silently.
Affected code paths:
-
matchesFilters(llm_deployment.go:829) —ListLLMProviders()/ListLLMProxies()with filter parameters (displayName, version, context, vhost) silently return empty results becauseAsAPIConfigData()errors andmatchesFiltersreturnsfalsefor every config. -
translateAPIConfig(translator.go:466) —TranslateConfigs()iterates all configs including LLM/MCP. SinceConfiguration.Kindis zero-value, LLM/MCP configs fall through totranslateAPIConfig()which fails on the zero-value Spec. xDS snapshots for these APIs are missing after restart. -
transformProxy(llm_transformer.go:109) — Deploying a new LLM proxy after restart fails because the referenced provider'sConfiguration.Spec.AsAPIConfigData()returns an error when reading vhost info.
Root cause:
In pkg/storage/sql_store.go unmarshalSourceConfig(), the RestApi/WebSubApi cases set both cfg.SourceConfiguration and cfg.Configuration, but the LlmProvider, LlmProxy, and Mcp cases only set cfg.SourceConfiguration.
Fix:
After setting SourceConfiguration for each LLM/MCP kind, rehydrate Configuration by building a minimal api.APIConfiguration with basic metadata (DisplayName, Version, Context, Vhosts, Upstream) derived from the source config — mirroring what the transformers produce at deployment time.
Version
No response
Related Issue
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/storage/sql_store.go at unmarshalSourceConfig and compare the LlmProvider, LlmProxy, and Mcp cases with RestApi and WebSubApi. Trace the affected paths in llm_deployment.go, translator.go, and llm_transformer.go, then verify that filters, TranslateConfigs, and new LLM proxy deployment work after a database reload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100