gastownhall/beads · error

invalid boolean value for %s: %s

Error message

invalid boolean value for %s: %s

What it means

Thrown when the value in a boolean field comparison (pinned, ephemeral, ...) is not one of the accepted literals: true/false, yes/no, 1/0 (case-insensitive). The field name and offending value are included in the message.

Source

Thrown at internal/query/evaluator.go:473

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

	switch field {
	case "pinned":
		filter.Pinned = &boolVal
	case "ephemeral":
		filter.Ephemeral = &boolVal
	case "template":
		filter.IsTemplate = &boolVal
	}
	return nil
}

func (e *Evaluator) applyMolTypeFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("mol_type only supports = operator")
	}
	mt := types.MolType(strings.ToLower(comp.Value))

View on GitHub (pinned to 71377f2769)

Solutions

  1. Change the value to one of true/false, yes/no, or 1/0.
  2. Strip surrounding quotes/whitespace from the literal in the query string.
  3. If the shell mangles the value, quote the whole query with single quotes.

Example fix

// before
bd list 'pinned = "yes"'
// after
bd list 'pinned = yes'
Defensive patterns

Strategy: validation

Validate before calling

func isValidBoolLiteral(v string) bool {
	switch strings.ToLower(strings.TrimSpace(v)) {
	case "true", "yes", "1", "false", "no", "0":
		return true
	}
	return false
}

Try / catch

if err != nil && strings.Contains(err.Error(), "invalid boolean value for") {
	// prompt the user for true/false/yes/no/1/0
}

Prevention

When it happens

Trigger: Queries like `pinned = maybe`, `ephemeral = 2`, `pinned = 'TRUE '` (with stray whitespace/quotes surviving shell parsing), or localized booleans like `pinned = wahr`.

Common situations: Localized or yes-with-exclamation values in saved queries; shell quoting leaving inner quotes in the value; numeric flags other than 0/1.

Related errors


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