plandex-ai/plandex · error

error during plan description model call: %v

Error message

error during plan description model call: %v

What it means

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.

Source

Thrown at app/server/model/plan/commit_msg.go:114

		Messages:       messages,
		ModelStreamId:  state.modelStreamId,
		ConvoMessageId: state.replyId,
		SessionId:      activePlan.SessionId,
		Settings:       settings,
		OrgUserConfig:  orgUserConfig,
	}

	if tools != nil {
		reqParams.Tools = tools
	}
	if toolChoice != nil {
		reqParams.ToolChoice = toolChoice
	}

	modelRes, err := model.ModelRequest(activePlan.Ctx, reqParams)

	if err != nil {
		go notify.NotifyErr(notify.SeverityError, fmt.Errorf("error during plan description model call: %v", err))

		return nil, &shared.ApiError{
			Type:   shared.ApiErrorTypeOther,
			Status: http.StatusInternalServerError,
			Msg:    fmt.Sprintf("error during plan description model call: %v", err),
		}
	}

	log.Println("Plan description model call complete")

	content := modelRes.Content

	var commitMsg string

	if baseModelConfig.PreferredOutputFormat == shared.ModelOutputFormatXml {
		commitMsg = utils.GetXMLContent(content, "commitMsg")
		if commitMsg == "" {
			go notify.NotifyErr(notify.SeverityError, fmt.Errorf("no commitMsg tag found in XML response"))

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check the CommitMsg model config in the org's model pack (model name, provider, baseURL, API key env var)
  2. Verify provider credentials and quota; test the same model with a direct API call
  3. Retry the request — transient provider/network errors are common
  4. Inspect the wrapped inner error (%v in the message) for the provider's actual status code

Example fix

// before: custom pack missing key
"CommitMsg": {"ModelConfig": {"Provider": "openai", "ModelName": "gpt-4o"}}
// after: ensure key env var is set and referenced
export OPENAI_API_KEY=sk-...
"CommitMsg": {"ModelConfig": {"Provider": "openai", "ModelName": "gpt-4o", "ApiKeyEnvVar": "OPENAI_API_KEY"}}
Defensive patterns

Strategy: retry

Validate before calling

// pre-flight: verify the provider credentials and model availability
curl -s $BASEURL/v1/models -H "Authorization: Bearer $API_KEY" | grep -q '<model-name>' || echo "model unavailable"

Try / catch

res, err := client.Tell(...)
if apiErr, ok := res.(*shared.ApiError); ok && strings.Contains(apiErr.Msg, "error during plan description model call") {
    // inspect wrapped provider error, back off, retry
    time.Sleep(2 * time.Second)
    return client.Tell(...)
}

Prevention

When it happens

Trigger: 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.

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

Related errors


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