{"record":{"id":"8ab20cdf2b6842f0","repo":"plandex-ai/plandex","slug":"failed-to-list-context-s","errorCode":null,"errorMessage":"failed to list context: %s","messagePattern":"failed to list context: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":37,"sourceCode":"\n\t\"github.com/fatih/color\"\n\t\"github.com/olekukonko/tablewriter\"\n)\n\nfunc CheckOutdatedContextWithOutput(quiet, autoConfirm bool, maybeContexts []*shared.Context, projectPaths *types.ProjectPaths) (contextOutdated, updated bool, err error) {\n\tif !quiet {\n\t\tterm.StartSpinner(\"🔬 Checking context...\")\n\t}\n\n\tvar contexts []*shared.Context\n\n\tif maybeContexts != nil {\n\t\tcontexts = maybeContexts\n\t} else {\n\t\tres, err := api.Client.ListContext(CurrentPlanId, CurrentBranch)\n\t\tif err != nil {\n\t\t\tterm.StopSpinner()\n\t\t\treturn false, false, fmt.Errorf(\"failed to list context: %s\", err)\n\t\t}\n\t\tcontexts = res\n\t}\n\n\toutdatedRes, err := CheckOutdatedContext(contexts, projectPaths)\n\tif err != nil {\n\t\tterm.StopSpinner()\n\t\treturn false, false, fmt.Errorf(\"failed to check outdated context: %s\", err)\n\t}\n\n\tif !quiet {\n\t\tterm.StopSpinner()\n\t}\n\n\tif len(outdatedRes.UpdatedContexts) == 0 && len(outdatedRes.RemovedContexts) == 0 {\n\t\tif !quiet {\n\t\t\tfmt.Println(\"✅ Context is up to date\")\n\t\t}","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L19-L55","documentation":"CheckOutdatedContextWithOutput fetches the current plan's context via api.Client.ListContext when it wasn't supplied; a failure there is wrapped with this message after stopping the spinner. It means the tool cannot determine whether context files are outdated because the server context listing is unavailable.","triggerScenarios":"maybeContexts is nil and api.Client.ListContext(CurrentPlanId, CurrentBranch) returns an error — network failure, auth expiry, deleted plan/branch, or server 5xx. Reached from MustApplyPlanAttempt before applying a plan.","commonSituations":"Offline work or flaky connection before applying a plan; plan deleted by a teammate; stale session after long idle.","solutions":["Check network connectivity and retry the apply/list command","Re-authenticate if the session expired","Verify the plan and branch still exist server-side (plandex plans / branches list)"],"exampleFix":"// before\nres, err := api.Client.ListContext(CurrentPlanId, CurrentBranch)\nif err != nil {\n    term.StopSpinner()\n    return false, false, fmt.Errorf(\"failed to list context: %s\", err)\n}\n// after — retry once on transient errors\nres, err := api.Client.ListContext(CurrentPlanId, CurrentBranch)\nif err != nil {\n    res, err = api.Client.ListContext(CurrentPlanId, CurrentBranch)\n    if err != nil {\n        term.StopSpinner()\n        return false, false, fmt.Errorf(\"failed to list context: %s\", err)\n    }\n}","handlingStrategy":"retry","validationCode":"if CurrentPlanId == \"\" {\n    return fmt.Errorf(\"no plan selected; cannot check outdated context\")\n}\nif err := checkApiReachable(); err != nil {\n    return fmt.Errorf(\"API unreachable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"res, err := api.Client.ListContext(CurrentPlanId, CurrentBranch)\nif err != nil {\n    time.Sleep(2 * time.Second)\n    res, err = api.Client.ListContext(CurrentPlanId, CurrentBranch)\n    if err != nil {\n        term.StopSpinner()\n        return false, false, fmt.Errorf(\"failed to list context: %s\", err)\n    }\n}","preventionTips":["Ensure connectivity before applying plans","Refresh authentication before long-running sessions","Confirm the plan/branch still exists before scripted applies"],"tags":["api","network","context"],"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-12T22:17:10.623Z"}