plandex-ai/plandex · error
error confirming update and rebuild: %v
Error message
error confirming update and rebuild: %v
What it means
When context updates conflict with pending changes, the CLI asks the user 'Update context and rebuild changes?' via term.ConfirmYesNo; this error means that confirmation prompt itself failed (rather than the user answering no). A failed prompt is treated as a hard error and returned to MustLoadContext/UpdateContext.
Source
Thrown at app/cli/lib/context_conflict.go:38
}
conflictedPaths := currentPlan.PlanResult.FileResultsByPath.ConflictedPaths(filesByPath)
// log.Println("Conflicted paths:", conflictedPaths)
if len(conflictedPaths) > 0 {
term.StopSpinner()
color.New(color.Bold, term.ColorHiYellow).Println("⚠️ Some updates conflict with pending changes:")
for path := range conflictedPaths {
fmt.Println("📄 " + path)
}
fmt.Println()
res, err := term.ConfirmYesNo("Update context and rebuild changes?")
if err != nil {
return false, fmt.Errorf("error confirming update and rebuild: %v", err)
}
if !res {
fmt.Println("Context update canceled")
os.Exit(0)
}
}
return len(conflictedPaths) > 0, nil
}
View on GitHub (pinned to e2d772072e)
Solutions
- Run the command in an interactive terminal so the confirmation prompt can be answered
- Pipe 'yes'/'y' into stdin if scripting, e.g. `yes | plandex context update ...`
- Use a non-interactive flag (-f/--yes if available) to auto-confirm or skip conflicts
- Split the operation into steps that don't require the conflict prompt
Example fix
// before
res, err := term.ConfirmYesNo("Update context and rebuild changes?")
if err != nil {
return false, fmt.Errorf("error confirming update and rebuild: %v", err)
}
// after
res, err := term.ConfirmYesNo("Update context and rebuild changes?")
if err != nil {
if nonInteractive { // e.g. CI or --yes flag set
return false, fmt.Errorf("conflicting updates require confirmation; pass --yes or run interactively: %w", err)
}
return false, fmt.Errorf("error confirming update and rebuild: %w", err)
} Defensive patterns
Strategy: fallback
Validate before calling
// detect non-interactive stdin before prompting
if fi, err := os.Stdin.Stat(); err != nil || (fi.Mode()&os.ModeCharDevice) == 0 {
return fmt.Errorf("interactive confirmation unavailable — pass --yes or run in a TTY")
} Type guard
// Go: check TTY-ness before prompting
func isInteractive() bool {
fi, err := os.Stdin.Stat()
return err == nil && (fi.Mode()&os.ModeCharDevice) != 0
} Try / catch
// Go: handle prompt failure with a flag-driven fallback
res, err := term.ConfirmYesNo("Update context and rebuild changes?")
if err != nil {
if autoConfirm { res = true } else { return false, fmt.Errorf("error confirming update and rebuild: %w", err) }
} Prevention
- Run context updates in an interactive terminal
- Provide a --yes/-f flag for scripted/CI usage
- Don't pipe stdin to commands that may prompt for confirmation
- Document CI behavior so jobs don't hang or fail on prompts
When it happens
Trigger: term.ConfirmYesNo returns an error, typically because stdin is not an interactive TTY (piped/closed stdin, CI environment, or EOF while reading the answer).
Common situations: Running the load/update command inside a CI job or script where stdin is closed or piped from a file; running with `plandex ... < /dev/null`; prompt library failing on a non-TTY terminal.
Related errors
- error selecting sign in option: %v
- error prompting pin: %v
- failed to get user input: %s
- error selecting or signing in to account: %v
- error prompting host: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/880d82391958be32.
Report an issue: GitHub.