plandex-ai/plandex · error

Error rejecting all changes:

Error message

Error rejecting all changes: 

What it means

RejectAllChangesHandler failed inside its write-lock ExecRepoOperation: db.RejectAllResults (deleting pending results) or repo.GitAddAndCommit (committing the rejection) returned an error. The handler responds 500 'Error rejecting all changes: <detail>' and the repo is cleared on error (ClearRepoOnErr) to avoid a corrupt state.

Source

Thrown at app/server/handlers/plans_changes.go:295

		CancelFn:       cancel,
		ClearRepoOnErr: true,
	}, func(repo *db.GitRepo) error {
		err := db.RejectAllResults(auth.OrgId, planId)
		if err != nil {
			return err
		}

		err = repo.GitAddAndCommit(branch, "🚫 Rejected all pending changes")
		if err != nil {
			return fmt.Errorf("error committing rejected changes: %v", err)
		}

		return nil
	})

	if err != nil {
		log.Printf("Error rejecting all changes: %v\n", err)
		http.Error(w, "Error rejecting all changes: "+err.Error(), http.StatusInternalServerError)
		return
	}

	log.Println("Successfully rejected all changes for plan", planId)
}

func RejectFileHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("Received request for RejectFileHandler")

	auth := Authenticate(w, r, true)
	if auth == nil {
		return
	}

	vars := mux.Vars(r)
	planId := vars["planId"]
	branch := vars["branch"]

View on GitHub (pinned to e2d772072e)

Solutions

  1. Read the appended error detail to see whether the DB delete or git commit failed
  2. If git identity is unconfigured, set user.name/user.email in the server environment
  3. Remove stale lock files (index.lock) from the plan repo and retry
  4. Wait for any in-flight apply/other operation to release the plan lock, then retry

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

const res = await fetch(rejectAllUrl, {method: 'POST'});
if (res.status === 500 && (await res.text()).includes('Error rejecting all changes')) {
  // DB delete or git commit failed: inspect detail, clear locks, retry
}

Prevention

When it happens

Trigger: RejectAllResults DB delete fails; GitAddAndCommit fails due to missing git identity, dirty index, stale lock files, or branch checkout problems; lock held by another operation; context cancelled mid-operation.

Common situations: Server container missing git user.name/user.email config; leftover .git/index.lock after a crash; concurrent apply in flight; Postgres outage during the delete.

Related errors


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