{"record":{"id":"1f270d5ae65166b2","repo":"plandex-ai/plandex","slug":"error-during-plan-description-model-call-v","errorCode":null,"errorMessage":"error during plan description model call: %v","messagePattern":"error during plan description model call: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/commit_msg.go","lineNumber":114,"sourceCode":"\t\tMessages:       messages,\n\t\tModelStreamId:  state.modelStreamId,\n\t\tConvoMessageId: state.replyId,\n\t\tSessionId:      activePlan.SessionId,\n\t\tSettings:       settings,\n\t\tOrgUserConfig:  orgUserConfig,\n\t}\n\n\tif tools != nil {\n\t\treqParams.Tools = tools\n\t}\n\tif toolChoice != nil {\n\t\treqParams.ToolChoice = toolChoice\n\t}\n\n\tmodelRes, err := model.ModelRequest(activePlan.Ctx, reqParams)\n\n\tif err != nil {\n\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"error during plan description model call: %v\", err))\n\n\t\treturn nil, &shared.ApiError{\n\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tMsg:    fmt.Sprintf(\"error during plan description model call: %v\", err),\n\t\t}\n\t}\n\n\tlog.Println(\"Plan description model call complete\")\n\n\tcontent := modelRes.Content\n\n\tvar commitMsg string\n\n\tif baseModelConfig.PreferredOutputFormat == shared.ModelOutputFormatXml {\n\t\tcommitMsg = utils.GetXMLContent(content, \"commitMsg\")\n\t\tif commitMsg == \"\" {\n\t\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"no commitMsg tag found in XML response\"))","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/commit_msg.go#L96-L132","documentation":"The plan-description LLM request made by genPlanDescription failed. model.ModelRequest returned an error (network failure, provider auth error, rate limit, context canceled, invalid model config) and the server wraps it into a 500 ApiError prefixed with this message, also sending an async error notification.","triggerScenarios":"The CommitMsg model pack entry points to an unavailable/misspelled model or provider; API keys are missing or invalid; network egress to the LLM provider fails; activePlan.Ctx was canceled mid-request (plan stopped); request exceeds provider rate limits or context window.","commonSituations":"Self-hosting with custom model packs where the baseURL or api key env var is wrong; OpenAI/Anthropic outage or 429s; user cancels the plan while the summary call is in flight; quota exhausted on the provider account.","solutions":["Check the CommitMsg model config in the org's model pack (model name, provider, baseURL, API key env var)","Verify provider credentials and quota; test the same model with a direct API call","Retry the request — transient provider/network errors are common","Inspect the wrapped inner error (%v in the message) for the provider's actual status code"],"exampleFix":"// before: custom pack missing key\n\"CommitMsg\": {\"ModelConfig\": {\"Provider\": \"openai\", \"ModelName\": \"gpt-4o\"}}\n// after: ensure key env var is set and referenced\nexport OPENAI_API_KEY=sk-...\n\"CommitMsg\": {\"ModelConfig\": {\"Provider\": \"openai\", \"ModelName\": \"gpt-4o\", \"ApiKeyEnvVar\": \"OPENAI_API_KEY\"}}","handlingStrategy":"retry","validationCode":"// pre-flight: verify the provider credentials and model availability\ncurl -s $BASEURL/v1/models -H \"Authorization: Bearer $API_KEY\" | grep -q '<model-name>' || echo \"model unavailable\"","typeGuard":null,"tryCatchPattern":"res, err := client.Tell(...)\nif apiErr, ok := res.(*shared.ApiError); ok && strings.Contains(apiErr.Msg, \"error during plan description model call\") {\n    // inspect wrapped provider error, back off, retry\n    time.Sleep(2 * time.Second)\n    return client.Tell(...)\n}","preventionTips":["Validate model pack config (provider, model name, API key env var) before deploying","Set up provider quota/rate-limit monitoring","Wrap LLM calls with exponential backoff for transient failures","Keep plan sessions short enough to avoid context cancellation mid-call"],"tags":["llm","network","model-config"],"backgroundTag":"llm-request-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}