{"record":{"id":"11f26b7c69eaec69","repo":"plandex-ai/plandex","slug":"error-generating-plan-name-v","errorCode":null,"errorMessage":"error generating plan name: %v","messagePattern":"error generating plan name: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"warning","filePath":"app/server/model/plan/tell_load.go","lineNumber":109,"sourceCode":"\t\t\t}\n\t\t\torgUserConfig = orgUserConfigRes\n\n\t\t\tif plan.Name == \"draft\" {\n\t\t\t\tname, err := model.GenPlanName(\n\t\t\t\t\tauth,\n\t\t\t\t\tplan,\n\t\t\t\t\tsettings,\n\t\t\t\t\torgUserConfig,\n\t\t\t\t\tclients,\n\t\t\t\t\tauthVars,\n\t\t\t\t\treq.Prompt,\n\t\t\t\t\tactive.SessionId,\n\t\t\t\t\tactive.Ctx,\n\t\t\t\t)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Error generating plan name: %v\\n\", err)\n\t\t\t\t\terrCh <- fmt.Errorf(\"error generating plan name: %v\", err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\terr = db.WithTx(active.Ctx, \"rename plan\", func(tx *sqlx.Tx) error {\n\t\t\t\t\terr := db.RenamePlan(planId, name, tx)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"Error renaming plan: %v\\n\", err)\n\t\t\t\t\t\treturn fmt.Errorf(\"error renaming plan: %v\", err)\n\t\t\t\t\t}\n\n\t\t\t\t\terr = db.IncNumNonDraftPlans(currentUserId, tx)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"Error incrementing num non draft plans: %v\\n\", err)\n\t\t\t\t\t\treturn fmt.Errorf(\"error incrementing num non draft plans: %v\", err)\n\t\t\t\t\t}\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_load.go#L91-L127","documentation":"model.GenPlanName failed while generating a descriptive name for a plan still called 'draft'. GenPlanName performs an internal LLM call; provider errors, auth failures, or context cancellation surface here. The wrapped error is sent on errCh and loading aborts (plan keeps its draft name).","triggerScenarios":"GenPlanName's internal LLM request fails during plan rename inside db.WithTx setup: invalid provider key, provider timeout, empty plan summary to name from, or canceled context.","commonSituations":"First tell on a brand-new draft plan while the provider API key is invalid/expired; provider rate limiting; network outage at plan creation time.","solutions":["Check the wrapped error for the underlying LLM failure (usually auth or network)","Verify provider API keys/auth vars, then retry the tell","Ensure the plan has enough content to generate a name, or rename the plan manually so GenPlanName is skipped","Retry later if the provider was rate-limited"],"exampleFix":"// before\nauthVars[\"ANTHROPIC_API_KEY\"] = \"\" // name-gen LLM call fails\n// after\nauthVars[\"ANTHROPIC_API_KEY\"] = os.Getenv(\"ANTHROPIC_API_KEY\") // set before Tell; draft gets renamed\n","handlingStrategy":"fallback","validationCode":"// ensure provider auth exists before Tell (plan rename needs an LLM call)\nif authVars[\"ANTHROPIC_API_KEY\"] == \"\" && authVars[\"OPENAI_API_KEY\"] == \"\" {\n    return errors.New(\"no provider API key configured; plan naming will fail\")\n}","typeGuard":null,"tryCatchPattern":"select {\ncase err := <-errCh:\n    if strings.HasPrefix(err.Error(), \"error generating plan name:\") {\n        // non-fatal: proceed with draft name or set a manual name, retry rename later\n    }\ncase <-doneCh:\n    // rename succeeded\n}","preventionTips":["Treat plan naming as best-effort: fall back to the draft name on failure","Verify provider API keys are valid before first tell on a draft plan","Handle provider rate limits with backoff inside GenPlanName","Rename plans manually when operating without LLM access"],"tags":["plan-naming","llm","database","draft"],"backgroundTag":"llm-stream-connection-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}