plandex-ai/plandex · error
failed to check context conflicts: %v
Error message
failed to check context conflicts: %v
What it means
Before applying an update, UpdateContext calls checkContextConflicts on all file-type contexts being updated or deleted to detect pending local changes that would conflict. If that internal check itself errors (not merely reports conflicts), the update aborts with this wrapper.
Source
Thrown at app/cli/lib/context_update.go:262
}
filesToLoad := map[string]string{}
for id := range req {
context := contextsById[id]
if context.ContextType == shared.ContextFileType {
filesToLoad[context.FilePath] = context.Body
}
}
for id := range deleteIds {
context := contextsById[id]
if context.ContextType == shared.ContextFileType {
filesToLoad[context.FilePath] = ""
}
}
hasConflicts, err = checkContextConflicts(filesToLoad)
if err != nil {
return UpdateContextResult{}, fmt.Errorf("failed to check context conflicts: %v", err)
}
if len(req) > 0 {
res, apiErr := api.Client.UpdateContext(CurrentPlanId, CurrentBranch, req)
if apiErr != nil {
return UpdateContextResult{}, fmt.Errorf("failed to update context: %v", apiErr)
}
msg = res.Msg
}
if len(deleteIds) > 0 {
res, apiErr := api.Client.DeleteContext(CurrentPlanId, CurrentBranch, shared.DeleteContextRequest{
Ids: deleteIds,
})
if apiErr != nil {
return UpdateContextResult{}, fmt.Errorf("failed to delete contexts: %v", apiErr)
}
msg += " " + res.MsgView on GitHub (pinned to e2d772072e)
Solutions
- Check the wrapped error for the failing path and fix its readability/existence
- Remove and re-add the problematic context entry (plandex context rm / plandex load)
- Re-run the command; transient races usually clear on retry
- If it persists on a specific file, report a bug with the file type and error
Example fix
// before: failing whole update on one unreadable file
hasConflicts, err := lib.UpdateContext(params)
// after: pre-validate files to load and drop broken ones
for _, c := range contexts {
if c.ContextType == shared.ContextFileType {
if _, err := os.Stat(c.FilePath); err != nil {
fmt.Printf("removing missing context %s (%s)\n", c.Id, c.FilePath)
}
}
}
hasConflicts, err := lib.UpdateContext(params) Defensive patterns
Strategy: validation
Validate before calling
for _, c := range contexts {
if c.ContextType == shared.ContextFileType {
if fi, err := os.Stat(c.FilePath); err != nil || fi.IsDir() {
return fmt.Errorf("context file %s not a readable file", c.FilePath)
}
}
} Try / catch
res, err := lib.UpdateContext(params)
if err != nil && strings.Contains(err.Error(), "failed to check context conflicts") {
return fmt.Errorf("conflict check failed; fix file access and retry: %w", err)
} Prevention
- Don't mutate context files while an update runs
- Remove context entries before deleting files locally
- Run as a user with read access to all context files
- Retry once on transient filesystem races
When it happens
Trigger: checkContextConflicts fails while reading/hash-checking filesToLoad — typically filesystem errors on context file paths (unreadable, removed mid-check), or an internal error in the diff/sha computation.
Common situations: Race: a file deleted between listing and conflict check; permission-restricted files; very large files causing read errors; a bug in the conflict checker on unusual file content.
Related errors
- failed to check outdated context: %s
- error loading accounts: %v
- no project root found
- error getting git root: %s
- error getting files in git repo: %s
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/0190ecf2877c12a8.
Report an issue: GitHub.