AI disclosure: This issue was drafted and analyzed with Codex using GPT-5.4. I have reviewed the analysis, and I am responsible for the content.
Summary
Custom model credential management breaks for workspaces that still have legacy model_type values in provider-related tables. Requests with canonical query values such as model_type=llm can return Credential with id ... not found, which prevents users from loading, updating, switching, or deleting OpenAI-compatible custom model credentials.
Root cause
The EnumText(ModelType) migration removed legacy query normalization from several read paths while keeping only result deserialization compatibility.
ModelType.value_of("text-generation") still deserializes legacy rows to ModelType.LLM, but SQL bind parameters are emitted as canonical values such as llm. Rows that still store legacy values such as text-generation or embeddings are therefore skipped by read queries.
The regression affects mixed datasets in tables including:
provider_models
tenant_default_models
provider_model_settings
provider_model_credentials
load_balancing_model_configs
Reproduction
- Persist a custom model credential row with
provider_model_credentials.model_type = 'text-generation'.
- Open the custom model credential endpoint with
model_type=llm.
- Observe
Credential with id ... not found.
Impact
- Users cannot load, update, switch, or delete affected custom model credentials.
- Available credential lists can appear empty.
- Default model and load balancing lookups can also miss legacy rows.
Proposed fix
Use a shared read-path helper that matches both canonical and legacy model_type values during queries, while keeping new writes on canonical enum values.
AI disclosure: This issue was drafted and analyzed with Codex using GPT-5.4. I have reviewed the analysis, and I am responsible for the content.
Summary
Custom model credential management breaks for workspaces that still have legacy
model_typevalues in provider-related tables. Requests with canonical query values such asmodel_type=llmcan returnCredential with id ... not found, which prevents users from loading, updating, switching, or deleting OpenAI-compatible custom model credentials.Root cause
The
EnumText(ModelType)migration removed legacy query normalization from several read paths while keeping only result deserialization compatibility.ModelType.value_of("text-generation")still deserializes legacy rows toModelType.LLM, but SQL bind parameters are emitted as canonical values such asllm. Rows that still store legacy values such astext-generationorembeddingsare therefore skipped by read queries.The regression affects mixed datasets in tables including:
provider_modelstenant_default_modelsprovider_model_settingsprovider_model_credentialsload_balancing_model_configsReproduction
provider_model_credentials.model_type = 'text-generation'.model_type=llm.Credential with id ... not found.Impact
Proposed fix
Use a shared read-path helper that matches both canonical and legacy
model_typevalues during queries, while keeping new writes on canonical enum values.