gastownhall/beads · error

parent only supports = operator

Error message

parent only supports = operator

What it means

Thrown when the `parent` field is compared with any operator other than `=`. Parent filtering only supports exact parent-ID equality (sets filter.ParentID); no inequality, comparison, or prefix operators exist for it.

Source

Thrown at internal/query/evaluator.go:455

	return nil
}

func (e *Evaluator) applySpecFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("spec only supports = operator")
	}
	// Support prefix matching
	if strings.HasSuffix(comp.Value, "*") {
		filter.SpecIDPrefix = strings.TrimSuffix(comp.Value, "*")
	} else {
		filter.SpecIDPrefix = comp.Value
	}
	return nil
}

func (e *Evaluator) applyParentFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("parent only supports = operator")
	}
	filter.ParentID = &comp.Value
	return nil
}

func (e *Evaluator) applyBoolFilter(comp *ComparisonNode, filter *types.IssueFilter, field string) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("%s only supports = operator", field)
	}
	val := strings.ToLower(comp.Value)
	var boolVal bool
	switch val {
	case "true", "yes", "1":
		boolVal = true
	case "false", "no", "0":
		boolVal = false
	default:
		return fmt.Errorf("invalid boolean value for %s: %s", field, comp.Value)

View on GitHub (pinned to 71377f2769)

Solutions

  1. Use `parent = <issue-id>` exactly.
  2. To exclude children of a parent, use a top-level `not`/negation if the query language supports it, or filter client-side.
  3. Note: unlike `id` and `spec`, `parent` does not document trailing-`*` prefix support — use the exact full ID.

Example fix

// before
bd list 'parent != bd-42'
// after
bd list 'not (parent = bd-42)'  // or filter client-side
Defensive patterns

Strategy: validation

Validate before calling

func validateParentComparison(op string) error {
	if op != "=" {
		return fmt.Errorf("parent supports only = with an exact issue ID, got %q", op)
	}
	return nil
}

Prevention

When it happens

Trigger: Queries like `parent != bd-1`, `parent = bd-1*` is fine but `parent ~ bd-1*` or `parent > x` reach the error branch.

Common situations: Trying to find issues NOT children of a given parent using `!=`; assuming prefix matching like `id`/`spec` support; stale queries from query-language changes.

Related errors


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