gastownhall/beads · error

label does not support %s operator

Error message

label does not support %s operator

What it means

The `label` field only supports Equals, NotEquals, and contains-style matching implemented inside the predicate's earlier cases. Any other operator reaches the default branch of buildLabelPredicate and returns this error. The label predicate also special-cases none/null for unlabeled issues.

Source

Thrown at internal/query/evaluator.go:845

					return true
				}
			}
			return false
		}, nil
	case OpNotEquals:
		if isNone {
			return func(i *types.Issue) bool { return len(i.Labels) > 0 }, nil
		}
		return func(i *types.Issue) bool {
			for _, l := range i.Labels {
				if strings.EqualFold(l, value) {
					return false
				}
			}
			return true
		}, nil
	default:
		return nil, fmt.Errorf("label does not support %s operator", comp.Op.String())
	}
}

func (e *Evaluator) buildTitlePredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {
	value := strings.ToLower(comp.Value)
	switch comp.Op {
	case OpEquals:
		return func(i *types.Issue) bool {
			return strings.Contains(strings.ToLower(i.Title), value)
		}, nil
	case OpNotEquals:
		return func(i *types.Issue) bool {
			return !strings.Contains(strings.ToLower(i.Title), value)
		}, nil
	default:
		return nil, fmt.Errorf("title does not support %s operator", comp.Op.String())
	}
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Use `label = <name>`, `label != <name>`, or the supported contains form.
  2. To match any of several labels, OR separate label filters.
  3. Use `label = none` to find unlabeled issues.

Example fix

// before
bd list --query "label > urgent"
// after
bd list --query "label = urgent OR label = blocked"
Defensive patterns

Strategy: validation

Validate before calling

// Go: label supports = / != / contains only
switch comp.Op {
case query.OpEquals, query.OpNotEquals:
    // ok
default:
    // only the contains form handled by the predicate; reject others
    if !isContainsOp(comp.Op) {
        return fmt.Errorf("label supports only =, !=, contains, got %s", comp.Op)
    }
}

Try / catch

// Go
pred, err := e.buildComparisonPredicate(node)
if err != nil {
    return fmt.Errorf("label filter invalid: %w", err)
}

Prevention

When it happens

Trigger: A query filter like `label > urgent` or `label <= blocked` — comparison on label with an operator outside the supported set (=, !=, and the contains case handled above the default).

Common situations: Assuming label supports the same operator set as priority (which has ordering); using range syntax to express "any of several labels"; dialect carryover from tag-search syntax in other tools.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/4e098823f8d73245. Report an issue: GitHub.