plandex-ai/plandex · error

error confirming: %v

Error message

error confirming: %v

What it means

After listing pending changes, the function asks the user 'Save changes now?' via term.ConfirmYesNo. Any failure from that interactive prompt is wrapped as 'error confirming: %v' — typically because stdin is not an interactive TTY or the read failed.

Source

Thrown at app/cli/lib/models_sync.go:76

		onApprove = append(onApprove, SyncPlanModelSettings)
	}

	if len(changes) == 0 {
		return nil
	}

	term.StopSpinner()
	color.New(color.Bold, term.ColorHiYellow).Println("⚠️  Model settings have local changes")

	fmt.Println()
	for _, change := range changes {
		fmt.Println(change)
	}
	fmt.Println()

	shouldSave, err := term.ConfirmYesNo("Save changes now?")
	if err != nil {
		return fmt.Errorf("error confirming: %v", err)
	}

	if !shouldSave {
		return nil
	}

	for _, fn := range onApprove {
		err := fn()
		if err != nil {
			return fmt.Errorf("error syncing models: %v", err)
		}
	}

	return nil
}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Run in an interactive terminal (allocate a TTY, e.g. docker run -it)
  2. Provide the non-interactive flag / auto-approve option the CLI offers, or pipe an answer (echo y | ...) if supported
  3. Check that stdin is not closed or redirected in your wrapper script
  4. Update term.ConfirmYesNo handling to fall back to a default answer when not a TTY

Example fix

// before
plandex plan ...   # in CI with no TTY -> error confirming
// after
plandex plan --auto-approve ...   # or run inside `script -qec` / a TTY
Defensive patterns

Strategy: fallback

Validate before calling

stat, _ := os.Stdin.Stat()
interactive := (stat.Mode() & os.ModeCharDevice) != 0
if !interactive {
	// use auto-approve flag or skip prompting instead of calling the sync flow
}

Try / catch

if err := lib.PromptSyncModelsIfNeeded(); err != nil {
	if strings.Contains(err.Error(), "error confirming") {
		// fall back to non-interactive mode or defer the sync
	}
	return err
}

Prevention

When it happens

Trigger: term.ConfirmYesNo errors: running under CI/non-interactive shells with no TTY, stdin closed or piped, or terminal read errors.

Common situations: Running plan commands in CI pipelines, Docker without -t, or scripts with redirected stdin where the interactive confirmation cannot be answered.

Related errors


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