{"record":{"id":"1a50874eafc37a1e","repo":"plandex-ai/plandex","slug":"error-getting-pending-builds-by-path-v-1a5087","errorCode":null,"errorMessage":"Error getting pending builds by path: %v","messagePattern":"Error getting pending builds by path: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/tell_build_pending.go","lineNumber":45,"sourceCode":"\t}\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tlog.Printf(\"panic in queuePendingBuilds: %v\\n%s\", r, debug.Stack())\n\t\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"error getting pending builds by path: %v\", r))\n\t\t\tactive.StreamDoneCh <- &shared.ApiError{\n\t\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\t\tStatus: http.StatusInternalServerError,\n\t\t\t\tMsg:    fmt.Sprintf(\"Error getting pending builds by path: %v\\n%s\", r, debug.Stack()),\n\t\t\t}\n\t\t}\n\t}()\n\n\tpendingBuildsByPath, err := active.PendingBuildsByPath(auth.OrgId, auth.User.Id, state.convo)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error getting pending builds by path: %v\\n\", err)\n\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"error getting pending builds by path: %v\", err))\n\n\t\tactive.StreamDoneCh <- &shared.ApiError{\n\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tMsg:    fmt.Sprintf(\"Error getting pending builds by path: %v\", err),\n\t\t}\n\t\treturn\n\t}\n\n\tif len(pendingBuildsByPath) == 0 {\n\t\tlog.Println(\"Tell plan: no pending builds\")\n\t\treturn\n\t}\n\n\tlog.Printf(\"Tell plan: found %d pending builds\\n\", len(pendingBuildsByPath))\n\t// spew.Dump(pendingBuildsByPath)\n\n\tbuildState := &activeBuildStreamState{","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_build_pending.go#L27-L63","documentation":"After a tell stream completes, queuePendingBuilds calls active.PendingBuildsByPath(orgId, userId, convo) to compute which file paths still need builds. If that call returns an error, it is logged, sent to error tracking, and delivered to the client as a 500 ApiError with message \"Error getting pending builds by path: %v\". The tell response itself succeeded, but the follow-up build queueing could not be determined.","triggerScenarios":"PendingBuildsByPath fails while processing the end of a tell plan — e.g. errors reading context map / context tokens, DB lookups for context, or computing pending builds from the convo history during execTellPlan.","commonSituations":"Corrupt or missing context entries in the DB (files removed externally while plan was streaming); DB connectivity blips mid-stream; large contexts exceeding internal limits; mismatched context map state after concurrent updates to the same plan.","solutions":["Check server logs for the log line 'Error getting pending builds by path' — the wrapped error names the actual failing subsystem (DB, context map, etc.).","Verify database integrity for the plan's context entries; reload/lock the plan's context if files changed externally.","Retry the tell request once the underlying cause is fixed; pending builds are recomputed each run.","If caused by concurrent updates, avoid updating plan context from another session while a tell stream is active."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before starting a tell stream, confirm plan context entries resolve\nfor path := range plan.ContextMap() {\n    if _, err := os.Stat(path); err != nil {\n        return fmt.Errorf(\"context file missing before tell: %s\", path)\n    }\n}","typeGuard":null,"tryCatchPattern":"apiErr := <-active.StreamDoneCh\nif strings.HasPrefix(apiErr.Msg, \"Error getting pending builds by path\") && !strings.Contains(apiErr.Msg, \"panic\") {\n    // non-panic DB/context error: safe to retry the tell request after the DB recovers\n    return retryTell(planId, branch)\n}","preventionTips":["Avoid updating plan context from another session while a tell stream is running.","Monitor DB connectivity; most cases are transient DB failures.","Re-sync context map if files were changed outside Plandex mid-stream.","Check server logs for the matching 'Error getting pending builds by path' line with the root cause."],"tags":["go","database","context-management","internal-error"],"backgroundTag":"pending-builds-computation-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"}