plandex-ai/plandex · error
%s is a built-in model pack name, so it can't be used for a
Error message
%s is a built-in model pack name, so it can't be used for a custom model pack
What it means
Custom model pack names must not shadow built-in model pack names (checked against shared.BuiltInModelPacksByName). A collision is rejected with HTTP 422 and a message naming the offending pack name, because built-in packs would be shadowed or ambiguously referenced in role config.
Source
Thrown at app/server/handlers/models.go:103
msg := fmt.Sprintf("%s is a built-in base model id, so it can't be used for a custom model", model.ModelId)
log.Println(msg)
http.Error(w, msg, http.StatusUnprocessableEntity)
return
}
}
for _, modelPack := range modelsInput.CustomModelPacks {
if modelPack.Name == "" {
msg := "Model pack name is required"
log.Println(msg)
http.Error(w, msg, http.StatusBadRequest)
return
}
if shared.BuiltInModelPacksByName[modelPack.Name] != nil {
msg := fmt.Sprintf("%s is a built-in model pack name, so it can't be used for a custom model pack", modelPack.Name)
log.Println(msg)
http.Error(w, msg, http.StatusUnprocessableEntity)
return
}
}
var existingCustomModelIds = make(map[shared.ModelId]bool)
var existingCustomProviderNames = make(map[string]bool)
customModels, err := db.ListCustomModels(auth.OrgId)
if err != nil {
log.Printf("Error fetching custom models: %v\n", err)
http.Error(w, "Failed to create custom model: "+err.Error(), http.StatusInternalServerError)
return
}
customModelPacks, err := db.ListModelPacks(auth.OrgId)
if err != nil {
log.Printf("Error fetching custom model packs: %v\n", err)
http.Error(w, "Failed to create custom model: "+err.Error(), http.StatusInternalServerError)View on GitHub (pinned to e2d772072e)
Solutions
- Rename the custom pack to a name not present in the built-in model packs table
- If you want built-in behavior, reference the built-in pack name directly in config rather than redefining it
- Create a modified copy under a new name if you need a variant of a built-in pack
- After upgrading Plandex, verify custom pack names against the new built-in pack list
Example fix
// before
{"customModelPacks": [{"name": "default", "models": {...}}]}
// after
{"customModelPacks": [{"name": "my-default", "models": {...}}]} Defensive patterns
Strategy: validation
Validate before calling
for _, p := range input.CustomModelPacks {
if shared.BuiltInModelPacksByName[p.Name] != nil {
return fmt.Errorf("%s is a built-in model pack name; choose a different name", p.Name)
}
} Type guard
func isBuiltInModelPackName(name string) bool { return shared.BuiltInModelPacksByName[name] != nil } Prevention
- Check custom pack names against shared.BuiltInModelPacksByName before submitting
- Prefix custom packs (e.g. 'my-') to avoid collisions with built-ins
- Re-validate pack names after Plandex upgrades
When it happens
Trigger: POSTing custom model packs where a pack's name equals a built-in pack name (e.g. "default", or any name defined in the shared built-in model packs table).
Common situations: Trying to override a built-in pack by reusing its name instead of inventing a new one; copying a built-in pack definition into custom packs and forgetting to rename it; a Plandex upgrade making a previously-legal custom pack name built-in.
Related errors
- %s is a built-in base model id, so it can't be used for a cu
- File %s is too large: %d (max %d)
- Has duplicates:
- Provider name is required
- Model id is required
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/6c8ad2eb8cc129ec.
Report an issue: GitHub.