{"record":{"id":"9107d29b7edd8543","repo":"plandex-ai/plandex","slug":"error-getting-custom-model-packs-v","errorCode":null,"errorMessage":"error getting custom model packs: %v","messagePattern":"error getting custom model packs: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/cmd/set_model.go","lineNumber":165,"sourceCode":"\t\tfor _, ms := range builtInModelPacks {\n\t\t\tif ms.LocalProvider == \"\" {\n\t\t\t\tfiltered = append(filtered, ms)\n\t\t\t}\n\t\t}\n\t\tbuiltInModelPacks = filtered\n\t}\n\n\tvar customModelPacks []*shared.ModelPack\n\tvar defaultConfig *shared.PlanConfig\n\tvar planConfig *shared.PlanConfig\n\n\terrCh := make(chan error, 3)\n\n\tgo func() {\n\t\tvar apiErr *shared.ApiError\n\t\tcustomModelPacks, apiErr = api.Client.ListModelPacks()\n\t\tif apiErr != nil {\n\t\t\terrCh <- fmt.Errorf(\"error getting custom model packs: %v\", apiErr.Msg)\n\t\t\treturn\n\t\t}\n\t\terrCh <- nil\n\t}()\n\n\tgo func() {\n\t\tvar apiErr *shared.ApiError\n\t\tdefaultConfig, apiErr = api.Client.GetDefaultPlanConfig()\n\t\tif apiErr != nil {\n\t\t\terrCh <- fmt.Errorf(\"error getting default config: %v\", apiErr.Msg)\n\t\t\treturn\n\t\t}\n\n\t\terrCh <- nil\n\t}()\n\n\tgo func() {\n\t\tif lib.CurrentPlanId != \"\" {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/set_model.go#L147-L183","documentation":"This error wraps a failure from api.Client.ListModelPacks() in set_model's parallel fetch (one of three goroutines feeding errCh). The *shared.ApiError Msg is interpolated into 'error getting custom model packs: %s'. It means the custom model packs listing failed, so the model selection flow cannot proceed.","triggerScenarios":"ListModelPacks() returning non-nil *shared.ApiError: invalid or expired API credentials, network failure, or the server rejecting the request (403 for lacking model-pack access, 500 server error).","commonSituations":"Token expiry during long sessions; org plan without custom model packs enabled; API outage; firewall/proxy blocking the endpoint.","solutions":["Re-authenticate to refresh the API token","Check the err.Msg embedded in the output for the HTTP status and message","Verify network/proxy connectivity to the API host","Confirm your org/account has access to custom model packs"],"exampleFix":"// before\nerrCh <- fmt.Errorf(\"error getting custom model packs: %v\", apiErr.Msg)\n// after\nerrCh <- fmt.Errorf(\"error getting custom model packs (status %d): %v\", apiErr.Status, apiErr.Msg)","handlingStrategy":"retry","validationCode":"// pre-flight: authenticated client with reachable API\nif api.Client == nil {\n\treturn fmt.Errorf(\"client not initialized: authenticate first\")\n}\nif err := api.Client.HealthCheck(); err != nil {\n\treturn fmt.Errorf(\"API unreachable: %w\", err)\n}","typeGuard":"func isApiErr(err error) (*shared.ApiError, bool) {\n\tae, ok := err.(*shared.ApiError)\n\treturn ae, ok\n}","tryCatchPattern":"packs, err := retry(3, backoff, func() ([]ModelPack, error) {\n\treturn api.Client.ListModelPacks()\n})\nif err != nil {\n\tif ae, ok := err.(*shared.ApiError); ok && ae.Status == 401 {\n\t\treturn reauth()\n\t}\n\treturn fmt.Errorf(\"error getting custom model packs: %w\", err)\n}","preventionTips":["Refresh auth tokens before long-running commands","Retry transient 5xx with exponential backoff","Confirm your plan/account enables custom model packs","Monitor API status for outages before bulk operations"],"tags":["go","cli","api","network"],"backgroundTag":"api-request-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}