{"record":{"id":"3e3b898a0f49e590","repo":"gastownhall/beads","slug":"invalid-status-q-in-multi-status-filter-valid","errorCode":null,"errorMessage":"invalid status %q in multi-status filter (valid: %s)","messagePattern":"invalid status %q in multi-status filter \\(valid: (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/workapi/list.go","lineNumber":523,"sourceCode":"\tif len(parts) == 1 {\n\t\ts := types.Status(parts[0])\n\t\tif !s.IsValidWithCustom(customStatusNames) {\n\t\t\treturn fmt.Errorf(\"invalid status %q (valid: %s)\", parts[0], ValidStatusList(customStatusNames))\n\t\t}\n\t\tfilter.Status = &s\n\t\treturn nil\n\t}\n\n\tfor _, part := range parts {\n\t\ts := types.Status(part)\n\t\tif !s.IsValidWithCustom(customStatusNames) {\n\t\t\t// \"all\" is a real selector on its own (every status), so failing\n\t\t\t// it as merely \"invalid\" would contradict the flag help. A custom\n\t\t\t// status literally named \"all\" passes validation above instead.\n\t\t\tif part == \"all\" {\n\t\t\t\treturn fmt.Errorf(`status \"all\" cannot be combined with other statuses`)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"invalid status %q in multi-status filter (valid: %s)\", part, ValidStatusList(customStatusNames))\n\t\t}\n\t\tfilter.Statuses = append(filter.Statuses, s)\n\t}\n\treturn nil\n}\n","sourceCodeStart":505,"sourceCodeEnd":529,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/workapi/list.go#L505-L529","documentation":"applyStatusParts rejects a status token in a multi-status list filter that is not one of the known statuses (open, in_progress, closed, plus any registered custom status names). The library throws this because an unrecognized status would silently produce an empty or meaningless filter. The comma-split values of the --status flag are validated one at a time, and the first invalid token is named verbatim in the error, along with the list of valid values.","triggerScenarios":"Calling BuildListFilter or ApplyStatusFilter with a status part string that matches no built-in status and no custom status name, e.g. \"bd list --status opne\" (typo) or \"--status Closed\" (wrong case).","commonSituations":"Typos in CLI flags; using a custom status name before it is registered; copying status values from an older version whose set of valid statuses differed; shell scripts hardcoding statuses that a teammate later renamed.","solutions":["Check the valid-status list printed in the error (ValidStatusList includes custom status names) and correct the spelling/case of the offending token","Run `bd status list` (or inspect configured custom statuses) to confirm the exact names available","If the status should exist, register the custom status first, then retry the filter","Split a compound --status value to find which single token is invalid"],"exampleFix":"// before\nbd list --status opne,in_progress\n// after\nbd list --status open,in_progress","handlingStrategy":"validation","validationCode":"func validStatus(s string, custom map[string]bool) bool {\n\tswitch s {\n\tcase \"open\", \"in_progress\", \"closed\", \"all\":\n\t\treturn true\n\t}\n\treturn custom[s]\n}","typeGuard":null,"tryCatchPattern":"if err := BuildListFilter(opts); err != nil {\n\tif strings.HasPrefix(err.Error(), \"invalid status\") {\n\t\tfmt.Fprintf(os.Stderr, \"bad --status value; see valid list in message\\n\")\n\t\tos.Exit(2)\n\t}\n\treturn err\n}","preventionTips":["Validate --status tokens against the valid list before building the filter","Never hardcode status strings; reference the canonical constants or registry","Register custom statuses before filtering on them","Watch for case mismatches — statuses are matched exactly"],"tags":["cli","validation","filtering","status"],"backgroundTag":"invalid-enum-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}