Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

Block custom models in integrated models mode

Dane Schneider28f0f4b44ea0
diff --git a/app/server/handlers/models.go b/app/server/handlers/models.go
index 0e1934d4..f309d705 100644
--- a/app/server/handlers/models.go
+++ b/app/server/handlers/models.go
@@ -42,6 +42,22 @@ func UpsertCustomModelsHandler(w http.ResponseWriter, r *http.Request) {
}
}
+ if len(modelsInput.CustomModels) > 0 {
+ if os.Getenv("IS_CLOUD") != "" {
+ apiOrg, err := getApiOrg(auth.OrgId)
+ if err != nil {
+ log.Printf("Error fetching org: %v\n", err)
+ http.Error(w, "Failed to create custom model: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+ if apiOrg.IntegratedModelsMode {
+ http.Error(w, "Custom models are not supported on Plandex Cloud in Integrated Models mode", http.StatusBadRequest)
+ return
+ }
+ }
+ }
+
hasDuplicates, errMsg := modelsInput.CheckNoDuplicates()
if !hasDuplicates {
http.Error(w, "Has duplicates: "+errMsg, http.StatusBadRequest)