{"record":{"id":"ff58eabee9982af4","repo":"gastownhall/beads","slug":"invalid-status-q-valid-s","errorCode":null,"errorMessage":"invalid status %q (valid: %s)","messagePattern":"invalid status %q \\(valid: (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/workapi/list.go","lineNumber":499,"sourceCode":"\t}\n\treturn false\n}\n\n// ValidStatusList renders the status names a filter accepts, for error text.\nfunc ValidStatusList(customStatusNames []string) string {\n\tvalidList := \"open, in_progress, blocked, deferred, closed, pinned, hooked\"\n\tif len(customStatusNames) > 0 {\n\t\tvalidList += \", \" + strings.Join(customStatusNames, \", \")\n\t}\n\treturn validList\n}\n\n// ApplyStatusFilter parses a status selector - one status, or a\n// comma-separated OR set - onto the filter.\nfunc ApplyStatusFilter(filter *types.IssueFilter, status string, customStatusNames []string) error {\n\tparts := splitStatusSelector(status)\n\tif len(parts) == 0 {\n\t\treturn fmt.Errorf(\"invalid status %q (valid: %s)\", status, ValidStatusList(customStatusNames))\n\t}\n\treturn applyStatusParts(filter, parts, customStatusNames)\n}\n\nfunc applyStatusParts(filter *types.IssueFilter, parts []string, customStatusNames []string) error {\n\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","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/workapi/list.go#L481-L517","documentation":"ApplyStatusFilter parses a status selector (single status or comma-separated set) onto an IssueFilter. If splitting the selector yields no parts — e.g. an empty or whitespace-only string after normalization — it is rejected as invalid, listing the valid statuses (built-ins plus custom status names).","triggerScenarios":"Calling ApplyStatusFilter with a status string that reduces to zero parts via splitStatusSelector (empty string, only commas/whitespace) even though a status was requested.","commonSituations":"Passing an empty --status flag value; shell quoting yielding only whitespace; programmatic callers building a status string from a variable that is empty.","solutions":["Pass a non-empty status or comma-separated list, e.g. \"open\" or \"open,in-progress\"","Check that the variable feeding the status parameter is populated","Use ValidStatusList(customStatusNames) to present valid choices before calling","If you want every status, pass the literal selector \"all\" instead of an empty string"],"exampleFix":"// before\nworkapi.ApplyStatusFilter(&filter, status, customStatuses) // status == \"  \"\n// after\nif strings.TrimSpace(status) != \"\" {\n    workapi.ApplyStatusFilter(&filter, status, customStatuses)\n}","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(status) != \"\" {\n    if err := workapi.ApplyStatusFilter(&filter, status, customStatusNames); err != nil { return err }\n}","typeGuard":null,"tryCatchPattern":"err := workapi.ApplyStatusFilter(&filter, status, customNames)\nif err != nil {\n    return fmt.Errorf(\"bad --status %q; valid: %s\", status, workapi.ValidStatusList(customNames))\n}","preventionTips":["Trim/validate status input before passing it","Never pass empty/whitespace-only status strings from scripts","Use ValidStatusList to validate or present options first","Prefer the \"all\" literal over an empty string for every-status queries"],"tags":["validation","status","cli"],"backgroundTag":"invalid-enum-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}