gastownhall/beads · error

type does not support %s operator

Error message

type does not support %s operator

What it means

The `type` (IssueType) field only supports Equals and NotEquals comparisons. Any other operator in a type comparison reaches the default branch of buildTypePredicate and returns this error. Issue types are categorical labels (bug, feature, task, etc.), so ordering comparisons are meaningless by design.

Source

Thrown at internal/query/evaluator.go:781

		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())
	}
}

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

func (e *Evaluator) buildAssigneePredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {
	value := comp.Value
	isNone := value == "" || strings.ToLower(value) == "none" || strings.ToLower(value) == "null"
	switch comp.Op {
	case OpEquals:
		if isNone {
			return func(i *types.Issue) bool { return i.Assignee == "" }, nil
		}
		return func(i *types.Issue) bool { return strings.EqualFold(i.Assignee, value) }, nil
	case OpNotEquals:
		if isNone {
			return func(i *types.Issue) bool { return i.Assignee != "" }, nil
		}
		return func(i *types.Issue) bool { return !strings.EqualFold(i.Assignee, value) }, nil
	default:

View on GitHub (pinned to 71377f2769)

Solutions

  1. Use `type = <type>` or `type != <type>` only.
  2. To exclude several types, chain with AND: `type != bug AND type != chore`.
  3. The value is lowercased before matching, so case does not need exactness.

Example fix

// before
bd list --query "type > bug"
// after
bd list --query "type != bug"
Defensive patterns

Strategy: validation

Validate before calling

// Go: type is categorical; enforce equality-only ops
if comp.Op != query.OpEquals && comp.Op != query.OpNotEquals {
    return fmt.Errorf("type supports only = and !=, got %s", comp.Op)
}

Try / catch

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

Prevention

When it happens

Trigger: A query filter like `type > bug` or `type <= task` — any comparison on type with an operator other than = or !=.

Common situations: Users trying to express ranges over categorical types; reusing a numeric-filter query template with the type field; dialect mix-ups from SQL or JQL where different semantics exist.

Related errors


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