{"record":{"id":"e3052278371edb45","repo":"plandex-ai/plandex","slug":"error-confirming-v","errorCode":null,"errorMessage":"error confirming: %v","messagePattern":"error confirming: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/models_sync.go","lineNumber":76,"sourceCode":"\t\tonApprove = append(onApprove, SyncPlanModelSettings)\n\t}\n\n\tif len(changes) == 0 {\n\t\treturn nil\n\t}\n\n\tterm.StopSpinner()\n\tcolor.New(color.Bold, term.ColorHiYellow).Println(\"⚠️  Model settings have local changes\")\n\n\tfmt.Println()\n\tfor _, change := range changes {\n\t\tfmt.Println(change)\n\t}\n\tfmt.Println()\n\n\tshouldSave, err := term.ConfirmYesNo(\"Save changes now?\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error confirming: %v\", err)\n\t}\n\n\tif !shouldSave {\n\t\treturn nil\n\t}\n\n\tfor _, fn := range onApprove {\n\t\terr := fn()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error syncing models: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":58,"sourceCodeEnd":92,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/models_sync.go#L58-L92","documentation":"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.","triggerScenarios":"term.ConfirmYesNo errors: running under CI/non-interactive shells with no TTY, stdin closed or piped, or terminal read errors.","commonSituations":"Running plan commands in CI pipelines, Docker without -t, or scripts with redirected stdin where the interactive confirmation cannot be answered.","solutions":["Run in an interactive terminal (allocate a TTY, e.g. docker run -it)","Provide the non-interactive flag / auto-approve option the CLI offers, or pipe an answer (echo y | ...) if supported","Check that stdin is not closed or redirected in your wrapper script","Update term.ConfirmYesNo handling to fall back to a default answer when not a TTY"],"exampleFix":"// before\nplandex plan ...   # in CI with no TTY -> error confirming\n// after\nplandex plan --auto-approve ...   # or run inside `script -qec` / a TTY","handlingStrategy":"fallback","validationCode":"stat, _ := os.Stdin.Stat()\ninteractive := (stat.Mode() & os.ModeCharDevice) != 0\nif !interactive {\n\t// use auto-approve flag or skip prompting instead of calling the sync flow\n}","typeGuard":null,"tryCatchPattern":"if err := lib.PromptSyncModelsIfNeeded(); err != nil {\n\tif strings.Contains(err.Error(), \"error confirming\") {\n\t\t// fall back to non-interactive mode or defer the sync\n\t}\n\treturn err\n}","preventionTips":["Run interactive commands inside a TTY (docker -it, script -qec)","Use the CLI's non-interactive/auto-approve flags in CI","Never pipe/close stdin for commands that prompt","Design wrappers to detect TTY availability first"],"tags":["go","cli","tty","interactive"],"backgroundTag":"no-tty-stdin","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}