{"record":{"id":"7555e4950fbe31dd","repo":"gastownhall/beads","slug":"label-only-supports-operator","errorCode":null,"errorMessage":"label only supports = operator","messagePattern":"label only supports = operator","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":294,"sourceCode":"\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"assignee only supports = operator\")\n\t}\n\tif comp.Value == \"\" || strings.ToLower(comp.Value) == \"none\" || strings.ToLower(comp.Value) == \"null\" {\n\t\tfilter.NoAssignee = true\n\t} else {\n\t\tfilter.Assignee = &comp.Value\n\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyOwnerFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\t// Owner filtering requires predicate\n\treturn fmt.Errorf(\"owner filtering requires predicate mode\")\n}\n\nfunc (e *Evaluator) applyLabelFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"label only supports = operator\")\n\t}\n\tif comp.Value == \"\" || strings.ToLower(comp.Value) == \"none\" || strings.ToLower(comp.Value) == \"null\" {\n\t\tfilter.NoLabels = true\n\t} else {\n\t\tfilter.Labels = append(filter.Labels, comp.Value)\n\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyTitleFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"title only supports = operator (use title contains pattern)\")\n\t}\n\tfilter.TitleContains = comp.Value\n\treturn nil\n}\n\nfunc (e *Evaluator) applyDescriptionFilter(comp *ComparisonNode, filter *types.IssueFilter) error {","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L276-L312","documentation":"applyLabelFilter only accepts the equality operator for label comparisons. Any other operator (!=, contains, >, etc.) on the label field is rejected with this error. Note the field is substring/list based: `label = none` or an empty value maps to NoLabels (issues with no labels).","triggerScenarios":"A query like `label != bug`, `label contains urgent`, or `label ~ foo` is parsed into a ComparisonNode with comp.Op != OpEquals and routed through applyComparison to applyLabelFilter.","commonSituations":"Users assuming label supports exclusion (!=) like the type field does; queries copied from JQL/GitHub search syntax that allow `label != x`; typos such as `label in (a,b)`.","solutions":["Use `label = <name>` for each label you want (they accumulate in filter.Labels)","Express exclusion differently: fetch with label filters and negate in application code, or use predicate mode if `label != x` is supported there","Split `label in (a,b)` into OR-ed `label = a OR label = b` clauses if the query grammar supports it"],"exampleFix":"// before\nbd list 'label != bug'\n// after\nbd list 'label = bug'   // then invert results client-side, or use predicate mode","handlingStrategy":"validation","validationCode":"// Ensure label comparisons use '=' only\nif comp.Field == \"label\" && comp.Op != OpEquals {\n\treturn fmt.Errorf(\"label supports only '='; got %s\", comp.Op.String())\n}","typeGuard":"func labelOpSupported(op Op) bool { return op == OpEquals }","tryCatchPattern":"if err := eval.applyComparison(comp, filter); err != nil {\n\tif strings.Contains(err.Error(), \"label only supports = operator\") {\n\t\t// rewrite query to label = <name> or fall back to predicate mode\n\t}\n}","preventionTips":["Always write label comparisons as `label = <name>`","Use `label = none` for issues without labels","Keep label exclusion logic in application code, not the query string"],"tags":["query","filter","label","unsupported-operator"],"backgroundTag":"unsupported-query-operator","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}