gastownhall/beads · error

owner filtering requires predicate mode

Error message

owner filtering requires predicate mode

What it means

The bd query evaluator rejects owner comparisons outright in filter mode: applyOwnerFilter always returns this error regardless of the operator or value used. Owner filtering was only implemented for predicate mode (full in-memory evaluation), so any query like `owner = alice` that goes down the IssueFilter path fails. It is a deliberate capability gate, not a data problem.

Source

Thrown at internal/query/evaluator.go:289

	}
	return nil
}

func (e *Evaluator) applyAssigneeFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("assignee only supports = operator")
	}
	if comp.Value == "" || strings.ToLower(comp.Value) == "none" || strings.ToLower(comp.Value) == "null" {
		filter.NoAssignee = true
	} else {
		filter.Assignee = &comp.Value
	}
	return nil
}

func (e *Evaluator) applyOwnerFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	// Owner filtering requires predicate
	return fmt.Errorf("owner filtering requires predicate mode")
}

func (e *Evaluator) applyLabelFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("label only supports = operator")
	}
	if comp.Value == "" || strings.ToLower(comp.Value) == "none" || strings.ToLower(comp.Value) == "null" {
		filter.NoLabels = true
	} else {
		filter.Labels = append(filter.Labels, comp.Value)
	}
	return nil
}

func (e *Evaluator) applyTitleFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("title only supports = operator (use title contains pattern)")
	}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Rewrite the query to use `assignee = <name>`, which is supported in filter mode
  2. Switch the evaluation to predicate mode if available in the calling code path
  3. If owner semantics are truly needed, filter results in application code after fetching by other criteria

Example fix

// before
bd list 'owner = alice'
// after
bd list 'assignee = alice'
Defensive patterns

Strategy: validation

Validate before calling

// Reject owner comparisons before invoking the evaluator
func usesOwnerField(q string) bool {
	return regexp.MustCompile(`\bowner\s*(=|!=|<|>|>=|<=)`).MatchString(q)
}
if usesOwnerField(query) {
	return fmt.Errorf("rewrite query: use 'assignee = <name>' instead of owner")
}

Type guard

func isSupportedFilterField(field string) bool {
	switch field {
	case "owner":
		return false // owner requires predicate mode
	}
	return true
}

Try / catch

if err := evaluator.Apply(comp, filter); err != nil {
	if strings.Contains(err.Error(), "owner filtering requires predicate mode") {
		// fall back to predicate-mode evaluation or rewrite to assignee
	}
}

Prevention

When it happens

Trigger: Running a query containing an `owner <op> value` comparison (e.g. `owner = alice`, `owner != bob`) that is evaluated via applyComparison in filter mode; the function returns this error unconditionally, before even inspecting comp.Op.

Common situations: Users migrating queries from assignee to owner fields (assignee supports =, owner does not); scripts written against predicate-mode docs; hand-written bd filter strings assuming owner is a first-class filterable field.

Related errors


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