plandex-ai/plandex · error

error invalidating conflicted results: %v

Error message

error invalidating conflicted results: %v

What it means

Before applying updates, UpdateContexts calls invalidateConflictedResults, which marks prior convo-message build results that conflict with the files being updated as invalidated. This wrapper means that invalidation flow failed — usually a database error fetching or updating ConvoMessageDescriptions, or a git operation inside that path failing.

Source

Thrown at app/server/db/context_helpers_update.go:244

				MaxTokensExceeded: true,
			}, nil
		}
	}
	filesToLoad := map[string]string{}
	for _, context := range updatedContexts {
		if context.ContextType == shared.ContextFileType {
			filesToLoad[context.FilePath] = (*req)[context.Id].Body
		}
	}

	if !params.SkipConflictInvalidation {
		err = invalidateConflictedResults(invalidateConflictedResultsParams{
			orgId:         orgId,
			planId:        planId,
			filesToUpdate: filesToLoad,
		})
		if err != nil {
			return nil, fmt.Errorf("error invalidating conflicted results: %v", err)
		}
	}

	errCh = make(chan error, len(*req))

	for id, params := range *req {
		go func(id string, params *shared.UpdateContextParams) {
			defer func() {
				if r := recover(); r != nil {
					log.Printf("panic in UpdateContexts: %v\n%s", r, debug.Stack())
					errCh <- fmt.Errorf("panic in UpdateContexts: %v\n%s", r, debug.Stack())
					runtime.Goexit() // don't allow outer function to continue and double-send to channel
				}
			}()
			context := contextsById[id]

			if context.ContextType == shared.ContextMapType {
				oldNumTokens := context.NumTokens

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check the inner %v error and database connectivity (Conn health, pool exhaustion)
  2. Retry the UpdateContexts call once the database is reachable
  3. Verify the plan/org still exists and no concurrent process deleted its rows
  4. Inspect app/server/db/context_helpers_conflicts.go to see which step (descriptions fetch vs invalidation write) failed
Defensive patterns

Strategy: retry

Try / catch

err := invalidateConflictedResults(params)
if err != nil {
    if isTransientDBError(err) {
        time.Sleep(backoff)
        err = invalidateConflictedResults(params)
    }
    return fmt.Errorf("error invalidating conflicted results: %v", err)
}

Prevention

When it happens

Trigger: UpdateContexts with filesToUpdate non-empty when GetConvoMessageDescriptions or a subsequent DB/git write inside invalidateConflictedResults returns an error (DB unreachable, transaction conflict, missing plan, git repo state issues).

Common situations: Postgres is down or connection pool exhausted; plan was deleted concurrently; conflicting concurrent updates from multiple clients cause git-level conflicts during invalidation.

Related errors


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