gastownhall/beads · error
invalid priority: %s
Error message
invalid priority: %s
What it means
Priority filters require an integer value. buildPriorityPredicate calls strconv.Atoi on the comparison value before applying the operator; a non-numeric value fails conversion and produces this error. Note priority in bd is a plain integer, not the P0-P4 label.
Source
Thrown at internal/query/evaluator.go:753
}
}
func (e *Evaluator) buildStatusPredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {
status := types.Status(strings.ToLower(comp.Value))
switch comp.Op {
case OpEquals:
return func(i *types.Issue) bool { return i.Status == status }, nil
case OpNotEquals:
return func(i *types.Issue) bool { return i.Status != status }, nil
default:
return nil, fmt.Errorf("status does not support %s operator", comp.Op.String())
}
}
func (e *Evaluator) buildPriorityPredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {
priority, err := strconv.Atoi(comp.Value)
if err != nil {
return nil, fmt.Errorf("invalid priority: %s", comp.Value)
}
switch comp.Op {
case OpEquals:
return func(i *types.Issue) bool { return i.Priority == priority }, nil
case OpNotEquals:
return func(i *types.Issue) bool { return i.Priority != priority }, nil
case OpLess:
return func(i *types.Issue) bool { return i.Priority < priority }, nil
case OpLessEq:
return func(i *types.Issue) bool { return i.Priority <= priority }, nil
case OpGreater:
return func(i *types.Issue) bool { return i.Priority > priority }, nil
case OpGreaterEq:
return func(i *types.Issue) bool { return i.Priority >= priority }, nil
default:
return nil, fmt.Errorf("unexpected operator: %s", comp.Op.String())
}
}View on GitHub (pinned to 71377f2769)
Solutions
- Use the bare integer in the filter, e.g. `priority = 1` or `priority <= 2`.
- Strip stray quotes, spaces, or P prefixes from the value.
- Check the issue's actual priority with `bd show <id>` to confirm the numeric form.
Example fix
// before bd list --query "priority = P1" // after bd list --query "priority = 1"
Defensive patterns
Strategy: validation
Validate before calling
// Go: ensure priority values are integers before querying
if _, err := strconv.Atoi(value); err != nil {
return fmt.Errorf("priority must be a number, got %q", value)
} Try / catch
// Go
pred, err := e.buildComparisonPredicate(node)
if err != nil {
return fmt.Errorf("filter %q rejected: %w", node.String(), err)
} Prevention
- Always pass priorities as bare integers (1, not P1 or high).
- Trim whitespace and quotes from values interpolated into queries.
- Map label-to-number in UI/CLI layers before building the filter.
When it happens
Trigger: A query filter like `priority = P1`, `priority > high`, or `priority = ""` — any comparison whose value cannot parse as an int.
Common situations: Typing the priority label (P1, high) instead of the numeric value; extra whitespace or quotes left in the query; confusion after a schema change from string priorities to integers.
Related errors
- unexpected operator: %s
- invalid priority value: %s
- priority must be between 0 and 4
- priority != requires predicate filtering
- priority < %d matches nothing
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/12914a7ad2071a7d.
Report an issue: GitHub.