plandex-ai/plandex · warning

Use POST /custom_models instead to update model packs

Error message

Use POST /custom_models instead to update model packs

What it means

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.

Source

Thrown at app/server/handlers/models.go:490

		return
	}

	http.Error(w, "Use POST /custom_models instead to create model packs", http.StatusBadRequest)
}

func UpdateModelPackHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("Received request for UpdateModelPackHandler")

	auth := Authenticate(w, r, true)
	if auth == nil {
		return
	}

	if !requireMinClientVersion(w, r, CustomModelsMinClientVersion) {
		return
	}

	http.Error(w, "Use POST /custom_models instead to update model packs", http.StatusBadRequest)
}

func ListModelPacksHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("Received request for ListModelPacksHandler")

	auth := Authenticate(w, r, true)
	if auth == nil {
		return
	}

	if !requireMinClientVersion(w, r, CustomModelsMinClientVersion) {
		return
	}

	sets, err := db.ListModelPacks(auth.OrgId)
	if err != nil {
		log.Printf("Error fetching model packs: %v\n", err)
		http.Error(w, "Failed to fetch model packs: "+err.Error(), http.StatusInternalServerError)

View on GitHub (pinned to e2d772072e)

Solutions

  1. Switch updates to POST /custom_models.
  2. Upgrade the Plandex client/CLI so it targets the custom models endpoints.
  3. Refresh any tooling or docs referencing legacy model-pack update routes.

Example fix

// before
POST /server/model_packs/{id} {"pack": {...}}
// after
POST /server/custom_models {"pack": {...}}
Defensive patterns

Strategy: validation

Validate before calling

// client-side: update via /custom_models, never the legacy route
const updateEndpoint = "/custom_models" // legacy /model_packs update returns 400

Type guard

func isLegacyModelPackRoute(path string) bool {
	return strings.HasPrefix(path, "/model_packs")
}

Try / catch

resp, err := client.Post(base+"/custom_models", "application/json", body)
if err != nil { return err }
if resp.StatusCode == 400 && strings.Contains(readBody(resp), "Use POST /custom_models") {
	return migrateToCustomModelsCall()
}

Prevention

When it happens

Trigger: Any POST/PUT to the legacy model-pack update endpoint from a client meeting CustomModelsMinClientVersion; older clients fail earlier at requireMinClientVersion.

Common situations: 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.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/3bc3b17e89e419cc. Report an issue: GitHub.