{"record":{"id":"3bc3b17e89e419cc","repo":"plandex-ai/plandex","slug":"use-post-custom-models-instead-to-update-model-pa","errorCode":null,"errorMessage":"Use POST /custom_models instead to update model packs","messagePattern":"Use POST /custom_models instead to update model packs","errorType":"http","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"app/server/handlers/models.go","lineNumber":490,"sourceCode":"\t\treturn\n\t}\n\n\thttp.Error(w, \"Use POST /custom_models instead to create model packs\", http.StatusBadRequest)\n}\n\nfunc UpdateModelPackHandler(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Received request for UpdateModelPackHandler\")\n\n\tauth := Authenticate(w, r, true)\n\tif auth == nil {\n\t\treturn\n\t}\n\n\tif !requireMinClientVersion(w, r, CustomModelsMinClientVersion) {\n\t\treturn\n\t}\n\n\thttp.Error(w, \"Use POST /custom_models instead to update model packs\", http.StatusBadRequest)\n}\n\nfunc ListModelPacksHandler(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Received request for ListModelPacksHandler\")\n\n\tauth := Authenticate(w, r, true)\n\tif auth == nil {\n\t\treturn\n\t}\n\n\tif !requireMinClientVersion(w, r, CustomModelsMinClientVersion) {\n\t\treturn\n\t}\n\n\tsets, err := db.ListModelPacks(auth.OrgId)\n\tif err != nil {\n\t\tlog.Printf(\"Error fetching model packs: %v\\n\", err)\n\t\thttp.Error(w, \"Failed to fetch model packs: \"+err.Error(), http.StatusInternalServerError)","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/models.go#L472-L508","documentation":"UpdateModelPackHandler is likewise a deprecated stub that returns HTTP 400 directing callers to POST /custom_models for updating model packs. Only authentication and the minimum client-version check precede the rejection.","triggerScenarios":"Any POST/PUT to the legacy model-pack update endpoint from a client meeting CustomModelsMinClientVersion; older clients fail earlier at requireMinClientVersion.","commonSituations":"Pinned CLI versions updating packs through the old route; CI pipelines scripted against the legacy API; third-party tools written before the custom_models migration.","solutions":["Switch updates to POST /custom_models.","Upgrade the Plandex client/CLI so it targets the custom models endpoints.","Refresh any tooling or docs referencing legacy model-pack update routes."],"exampleFix":"// before\nPOST /server/model_packs/{id} {\"pack\": {...}}\n// after\nPOST /server/custom_models {\"pack\": {...}}","handlingStrategy":"validation","validationCode":"// client-side: update via /custom_models, never the legacy route\nconst updateEndpoint = \"/custom_models\" // legacy /model_packs update returns 400","typeGuard":"func isLegacyModelPackRoute(path string) bool {\n\treturn strings.HasPrefix(path, \"/model_packs\")\n}","tryCatchPattern":"resp, err := client.Post(base+\"/custom_models\", \"application/json\", body)\nif err != nil { return err }\nif resp.StatusCode == 400 && strings.Contains(readBody(resp), \"Use POST /custom_models\") {\n\treturn migrateToCustomModelsCall()\n}","preventionTips":["Upgrade CLIs/SDKs that still write model packs via the legacy route.","Audit CI pipelines for calls to /model_packs update endpoints.","Treat 'Use POST /custom_models instead' messages as an automatic migration signal."],"tags":["http-400","deprecated-endpoint","migration","api-change"],"backgroundTag":"deprecated-endpoint","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}