Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
always write hash when custom models is saved to prevent unneeded save prompt. fix docs link in credentials message
Dane Schneider0644af53bc78
diff --git a/app/cli/cmd/models.go b/app/cli/cmd/models.goindex 9d76e053..0ab22a2d 100644--- a/app/cli/cmd/models.go+++ b/app/cli/cmd/models.go@@ -205,7 +205,7 @@ func manageCustomModels(cmd *cobra.Command, args []string) {}if !serverModelsInput.Equals(localModelsInput) {- err := lib.WriteCustomModelsFile(customModelsPath, serverModelsInput, true)+ err := lib.WriteCustomModelsFile(customModelsPath, serverModelsInput)if err != nil {term.OutputErrorAndExit("Error saving custom models file: %v", err)return@@ -230,7 +230,7 @@ func manageCustomModels(cmd *cobra.Command, args []string) {}}- didUpdate := lib.MustSyncCustomModels(customModelsPath, serverModelsInput, saveCustomModels)+ didUpdate := lib.MustSyncCustomModels(customModelsPath, serverModelsInput)if !didUpdate {fmt.Println("🤷♂️ No changes to custom models/providers/model packs")@@ -552,6 +552,11 @@ func getExampleTemplate(isCloud, isCloudIntegratedModels bool) shared.ClientMode}}+ lightModelId := "meta-llama/llama-4-maverick"+ if len(customModels) == 0 {+ lightModelId = "mistral/devstral-small"+ }+return shared.ClientModelsInput{SchemaUrl: shared.SchemaUrlInputConfig,CustomProviders: customProviders,@@ -564,12 +569,12 @@ func getExampleTemplate(isCloud, isCloudIntegratedModels bool) shared.ClientModePlanner: "deepseek/r1",Architect: "deepseek/r1",Coder: "deepseek/v3-0324",- PlanSummary: "meta-llama/llama-4-maverick",+ PlanSummary: lightModelId,Builder: "deepseek/r1-hidden",WholeFileBuilder: "deepseek/r1-hidden",ExecStatus: "deepseek/r1-hidden",- Namer: "meta-llama/llama-4-maverick",- CommitMsg: "meta-llama/llama-4-maverick",+ Namer: lightModelId,+ CommitMsg: lightModelId,},},},diff --git a/app/cli/lib/custom_models.go b/app/cli/lib/custom_models.goindex ccd890ed..d071bef9 100644--- a/app/cli/lib/custom_models.go+++ b/app/cli/lib/custom_models.go@@ -118,6 +118,7 @@ func CustomModelsCheckLocalChanges(path string) (CustomModelsCheckLocalChangesRelocalModelsInput := localClientModelsInput.ToModelsInput()lastSavedHash, err := os.ReadFile(hashPath)+if err != nil && !os.IsNotExist(err) {return CustomModelsCheckLocalChangesResult{}, fmt.Errorf("error reading hash file: %v", err)}@@ -133,7 +134,7 @@ func CustomModelsCheckLocalChanges(path string) (CustomModelsCheckLocalChangesRe}, nil}-func WriteCustomModelsFile(path string, modelsInput *shared.ModelsInput, saveHash bool) error {+func WriteCustomModelsFile(path string, modelsInput *shared.ModelsInput) error {err := os.MkdirAll(filepath.Dir(path), 0755)if err != nil {return fmt.Errorf("error creating directory: %v", err)@@ -152,11 +153,9 @@ func WriteCustomModelsFile(path string, modelsInput *shared.ModelsInput, saveHasreturn fmt.Errorf("error writing file: %v", err)}- if saveHash {- err = SaveCustomModelsHash(path, modelsInput)- if err != nil {- return fmt.Errorf("error saving hash file: %v", err)- }+ err = SaveCustomModelsHash(path, modelsInput)+ if err != nil {+ return fmt.Errorf("error saving hash file: %v", err)}return nil@@ -178,7 +177,7 @@ func SaveCustomModelsHash(basePath string, modelsInput *shared.ModelsInput) erroreturn nil}-func MustSyncCustomModels(path string, serverModelsInput *shared.ModelsInput, saveHash bool) bool {+func MustSyncCustomModels(path string, serverModelsInput *shared.ModelsInput) bool {term.StartSpinner("")jsonData, err := os.ReadFile(path)@@ -217,12 +216,10 @@ func MustSyncCustomModels(path string, serverModelsInput *shared.ModelsInput, sareturn false}- if saveHash {- err := SaveCustomModelsHash(path, &modelsInput)- if err != nil {- term.OutputErrorAndExit("Error saving hash file: %v", err)- return false- }+ err = SaveCustomModelsHash(path, &modelsInput)+ if err != nil {+ term.OutputErrorAndExit("Error saving hash file: %v", err)+ return false}inputModelIds := map[string]bool{}@@ -338,7 +335,7 @@ func SyncCustomModels() error {return fmt.Errorf("error getting server models input: %v", err)}- MustSyncCustomModels(CustomModelsDefaultPath, serverModelsInput, true)+ MustSyncCustomModels(CustomModelsDefaultPath, serverModelsInput)return nil}diff --git a/app/cli/lib/model_credentials.go b/app/cli/lib/model_credentials.goindex e6d6247a..793036e6 100644--- a/app/cli/lib/model_credentials.go+++ b/app/cli/lib/model_credentials.go@@ -417,7 +417,7 @@ func showCredentialErrorMessage(res CredentialCheckResult, opts shared.ModelProv// TODO: set correct linkfmt.Println(color.New(color.Bold, term.ColorHiCyan).Sprint("\n📖 Per-provider instructions"))- fmt.Println("For details on the API key/credentials required for each provider, go to:\n" + color.New(color.Bold).Sprint("https://docs.plandex.ai/guides/..."))+ fmt.Println("For details on the API key/credentials required for each provider, go to:\n" + color.New(color.Bold).Sprint("https://docs.plandex.ai/models/model-providers"))}fmt.Println()