{"record":{"id":"447e0cf9a2242cd1","repo":"plandex-ai/plandex","slug":"no-model-pack-name-or-model-pack-provided","errorCode":null,"errorMessage":"No model pack name or model pack provided","messagePattern":"No model pack name or model pack provided","errorType":"http","errorClass":"http","httpStatus":400,"severity":"warning","filePath":"app/server/handlers/settings.go","lineNumber":111,"sourceCode":"\n\tplan := authorizePlan(w, planId, auth)\n\n\tif plan == nil {\n\t\treturn\n\t}\n\n\tvar req shared.UpdateSettingsRequest\n\terr := json.NewDecoder(r.Body).Decode(&req)\n\n\tif err != nil {\n\t\tlog.Println(\"Error decoding request body: \", err)\n\t\thttp.Error(w, \"Error decoding request body\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif req.ModelPackName == \"\" && req.ModelPack == nil {\n\t\tlog.Println(\"No model pack name or model pack provided\")\n\t\thttp.Error(w, \"No model pack name or model pack provided\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif req.ModelPackName != \"\" {\n\t\tif mp, builtIn := shared.BuiltInModelPacksByName[req.ModelPackName]; builtIn {\n\t\t\tif os.Getenv(\"IS_CLOUD\") != \"\" && mp.LocalProvider != \"\" {\n\t\t\t\tmsg := fmt.Sprintf(\"Built-in local model pack %s can't be used on Plandex Cloud\", req.ModelPackName)\n\t\t\t\tlog.Println(msg)\n\t\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tif req.ModelPack != nil {\n\t\tif req.ModelPack.LocalProvider != \"\" {\n\t\t\tmsg := fmt.Sprintf(\"Local model pack %s can't be used on Plandex Cloud\", req.ModelPack.Name)\n\t\t\tlog.Println(msg)","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/settings.go#L93-L129","documentation":"UpdateSettingsHandler requires at least one of ModelPackName (string) or ModelPack (object) in the request. When both are absent/empty it returns HTTP 400 'No model pack name or model pack provided'. It's a validation guard against empty settings updates.","triggerScenarios":"POST to the update-settings endpoint with a decoded body where ModelPackName == \"\" and ModelPack == nil, e.g. body {} or {\"modelPackName\":\"\"}.","commonSituations":"Client code builds UpdateSettingsRequest but never assigns the model pack fields; a UI 'save' sends the settings object without the selected pack; API change renamed the field so the server no longer sees it.","solutions":["Include either modelPackName (a built-in pack name) or modelPack (a full pack object) in the request body","Check the client is actually setting the field (watch for field-name casing/renames)","If updating other settings, ensure the endpoint supports partial updates or send the current pack unchanged"],"exampleFix":"// before\n{\"autoContinue\": true}\n// after\n{\"autoContinue\": true, \"modelPackName\": \"default\"}","handlingStrategy":"validation","validationCode":"func validateUpdateSettings(req shared.UpdateSettingsRequest) error {\n    if req.ModelPackName == \"\" && req.ModelPack == nil {\n        return errors.New(\"modelPackName or modelPack is required\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := validateUpdateSettings(req); err != nil {\n    return err\n}\nresp, err := client.UpdateSettings(ctx, req)","preventionTips":["Check field names against the current UpdateSettingsRequest schema (renames break it)","Only build the request through typed constructors, never raw maps","In UIs, disable 'save' until a model pack is selected"],"tags":["http","validation","request"],"backgroundTag":"missing-required-argument","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"}