{"record":{"id":"61538fb067670a1c","repo":"plandex-ai/plandex","slug":"debug-value-must-be-greater-than-0","errorCode":null,"errorMessage":"--debug value must be greater than 0","messagePattern":"--debug value must be greater than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/cmd/plan_exec_helpers.go","lineNumber":241,"sourceCode":"\tvalue *int\n}\n\nfunc newAutoDebugValue(p *int) *autoDebugValue {\n\t*p = 0 // Default to 0 (disabled)\n\treturn &autoDebugValue{p}\n}\n\nfunc (f *autoDebugValue) Set(s string) error {\n\tif s == \"\" {\n\t\t*f.value = defaultAutoDebugTries\n\t\treturn nil\n\t}\n\tv, err := strconv.Atoi(s)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid value for --debug: %v\", err)\n\t}\n\tif v <= 0 {\n\t\treturn fmt.Errorf(\"--debug value must be greater than 0\")\n\t}\n\t*f.value = v\n\treturn nil\n}\n\nfunc (f *autoDebugValue) String() string {\n\tif f.value == nil {\n\t\treturn \"0\"\n\t}\n\treturn strconv.Itoa(*f.value)\n}\n\nfunc (f *autoDebugValue) Type() string {\n\treturn \"int\"\n}\n\n// EditorValue implements the flag.Value interface\ntype editorValue struct {","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/plan_exec_helpers.go#L223-L259","documentation":"This error is thrown by autoDebugValue.Set when the --debug value parses as an integer but is zero or negative. The flag requires a strictly positive integer (number of debug tries). It is a range-validation error, not a parse error.","triggerScenarios":"Passing --debug=0 or a negative value like --debug=-1 to a command that accepts autoDebugValue.","commonSituations":"Trying to 'disable' debug by passing 0 (omit the flag instead), scripting with a computed value that resolved to 0 or negative.","solutions":["Pass a value >= 1, e.g. --debug=1","Omit --debug entirely to use the default autoDebugTries","Fix the script/computation producing 0 or negative values"],"exampleFix":"// before\nplandex tell -f plan.md --debug=0\n// after\nplandex tell -f plan.md --debug=1","handlingStrategy":"validation","validationCode":"if v, err := strconv.Atoi(debugArg); err != nil || v <= 0 {\n    return fmt.Errorf(\"--debug must be >= 1\")\n}","typeGuard":"func isPositiveInt(s string) bool {\n    v, err := strconv.Atoi(s)\n    return err == nil && v > 0\n}","tryCatchPattern":null,"preventionTips":["Omit --debug to disable; don't pass 0","Guard computed values: max(1, computed)","Use --debug=1 as the minimum","Add shell-level validation in scripts"],"tags":["cli","validation","flags"],"backgroundTag":"invalid-flag-value","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"}