{"record":{"id":"6c8ad2eb8cc129ec","repo":"plandex-ai/plandex","slug":"s-is-a-built-in-model-pack-name-so-it-can-t-be-u","errorCode":null,"errorMessage":"%s is a built-in model pack name, so it can't be used for a custom model pack","messagePattern":"(.+?) is a built-in model pack name, so it can't be used for a custom model pack","errorType":"validation","errorClass":null,"httpStatus":422,"severity":"error","filePath":"app/server/handlers/models.go","lineNumber":103,"sourceCode":"\t\t\tmsg := fmt.Sprintf(\"%s is a built-in base model id, so it can't be used for a custom model\", model.ModelId)\n\t\t\tlog.Println(msg)\n\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfor _, modelPack := range modelsInput.CustomModelPacks {\n\t\tif modelPack.Name == \"\" {\n\t\t\tmsg := \"Model pack name is required\"\n\t\t\tlog.Println(msg)\n\t\t\thttp.Error(w, msg, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tif shared.BuiltInModelPacksByName[modelPack.Name] != nil {\n\t\t\tmsg := fmt.Sprintf(\"%s is a built-in model pack name, so it can't be used for a custom model pack\", modelPack.Name)\n\t\t\tlog.Println(msg)\n\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar existingCustomModelIds = make(map[shared.ModelId]bool)\n\tvar existingCustomProviderNames = make(map[string]bool)\n\n\tcustomModels, err := db.ListCustomModels(auth.OrgId)\n\tif err != nil {\n\t\tlog.Printf(\"Error fetching custom models: %v\\n\", err)\n\t\thttp.Error(w, \"Failed to create custom model: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tcustomModelPacks, err := db.ListModelPacks(auth.OrgId)\n\tif err != nil {\n\t\tlog.Printf(\"Error fetching custom model packs: %v\\n\", err)\n\t\thttp.Error(w, \"Failed to create custom model: \"+err.Error(), http.StatusInternalServerError)","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/models.go#L85-L121","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\n{\"customModelPacks\": [{\"name\": \"default\", \"models\": {...}}]}\n// after\n{\"customModelPacks\": [{\"name\": \"my-default\", \"models\": {...}}]}","handlingStrategy":"validation","validationCode":"for _, p := range input.CustomModelPacks {\n    if shared.BuiltInModelPacksByName[p.Name] != nil {\n        return fmt.Errorf(\"%s is a built-in model pack name; choose a different name\", p.Name)\n    }\n}","typeGuard":"func isBuiltInModelPackName(name string) bool { return shared.BuiltInModelPacksByName[name] != nil }","tryCatchPattern":null,"preventionTips":["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"],"tags":["http","go","validation","naming-conflict","unprocessable-entity"],"backgroundTag":"reserved-identifier-conflict","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}