plandex-ai/plandex · error
--debug value must be greater than 0
Error message
--debug value must be greater than 0
What it means
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.
Source
Thrown at app/cli/cmd/plan_exec_helpers.go:241
value *int
}
func newAutoDebugValue(p *int) *autoDebugValue {
*p = 0 // Default to 0 (disabled)
return &autoDebugValue{p}
}
func (f *autoDebugValue) Set(s string) error {
if s == "" {
*f.value = defaultAutoDebugTries
return nil
}
v, err := strconv.Atoi(s)
if err != nil {
return fmt.Errorf("invalid value for --debug: %v", err)
}
if v <= 0 {
return fmt.Errorf("--debug value must be greater than 0")
}
*f.value = v
return nil
}
func (f *autoDebugValue) String() string {
if f.value == nil {
return "0"
}
return strconv.Itoa(*f.value)
}
func (f *autoDebugValue) Type() string {
return "int"
}
// EditorValue implements the flag.Value interface
type editorValue struct {View on GitHub (pinned to e2d772072e)
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
Example fix
// before plandex tell -f plan.md --debug=0 // after plandex tell -f plan.md --debug=1
Defensive patterns
Strategy: validation
Validate before calling
if v, err := strconv.Atoi(debugArg); err != nil || v <= 0 {
return fmt.Errorf("--debug must be >= 1")
} Type guard
func isPositiveInt(s string) bool {
v, err := strconv.Atoi(s)
return err == nil && v > 0
} Prevention
- 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
When it happens
Trigger: Passing --debug=0 or a negative value like --debug=-1 to a command that accepts autoDebugValue.
Common situations: Trying to 'disable' debug by passing 0 (omit the flag instead), scripting with a computed value that resolved to 0 or negative.
Understand the failure class
Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.
Related errors
- invalid value for --debug: %v
- invalid context index: %s
- no context found with name: %s
- run command requires exactly one file path argument
- invalid value: %s
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/61538fb067670a1c.
Report an issue: GitHub.