gastownhall/beads · error
closed does not support %s operator
Error message
closed does not support %s operator
What it means
This error is thrown by the query evaluator when a query compares the `closed` field with an operator other than `<` or `<=` (e.g. `closed > ...`, `closed = ...`). The `closed` timestamp only maps to ClosedBefore/ClosedAfter-style filters via less-than comparisons, so any other operator is rejected. It is a query-syntax validation error, not a runtime failure.
Source
Thrown at internal/query/evaluator.go:401
}
func (e *Evaluator) applyClosedFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
t, err := e.parseTimeValue(comp)
if err != nil {
return fmt.Errorf("invalid closed time: %w", err)
}
switch comp.Op {
case OpGreater:
filter.ClosedAfter = &t
case OpGreaterEq:
filter.ClosedAfter = &t
case OpLess:
filter.ClosedBefore = &t
case OpLessEq:
endOfDay := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 999999999, t.Location())
filter.ClosedBefore = &endOfDay
default:
return fmt.Errorf("closed does not support %s operator", comp.Op.String())
}
return nil
}
func (e *Evaluator) applyStartedFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
t, err := e.parseTimeValue(comp)
if err != nil {
return fmt.Errorf("invalid started time: %w", err)
}
switch comp.Op {
case OpGreater:
filter.StartedAfter = &t
case OpGreaterEq:
filter.StartedAfter = &t
case OpLess:
filter.StartedBefore = &t
case OpLessEq:
endOfDay := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 999999999, t.Location())View on GitHub (pinned to 71377f2769)
Solutions
- Rewrite the comparison to use `<` or `<=` on `closed` (e.g. `closed <= 2024-06-01` means closed before end of that day).
- To express 'closed after a date', use the appropriate supported filter or combine with a different field if the query language offers closed-after syntax only through >= on other time fields — check supported operators for `closed`.
- Validate the query with the query parser/list command before embedding it in scripts to get this error up front.
Example fix
// before (query) bd list 'closed = 2024-06-01' // after (query) bd list 'closed <= 2024-06-01'
Defensive patterns
Strategy: validation
Validate before calling
func validateClosedOp(op string) error {
if op != "<" && op != "<=" {
return fmt.Errorf("closed supports only < and <=, got %q", op)
}
return nil
} Prevention
- Only build `closed` comparisons with < or <=.
- Test queries through the parser before scripting them.
- Encode allowed operators per field in any query-builder UI.
When it happens
Trigger: Running a query like `closed = 2024-01-01`, `closed >= yesterday`, or `closed != today` — any ComparisonNode on field "closed" whose Op is not OpLess or OpLessEq reaches the default branch of applyClosedFilter.
Common situations: Users writing `closed = <date>` expecting exact-day equality instead of `closed <= <date>`; hand-editing saved queries; porting SQL habits (`closed > x`) into the bd query language.
Related errors
- started does not support %s operator
- id only supports = operator
- spec only supports = operator
- parent only supports = operator
- %s only supports = operator
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/f3656c22d0f6a171.
Report an issue: GitHub.