{"record":{"id":"3c441effada588ad","repo":"cli/cli","slug":"task-description-file-cannot-be-empty","errorCode":null,"errorMessage":"task description file cannot be empty","messagePattern":"task description file cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/cmd/agent-task/create/create.go","lineNumber":140,"sourceCode":"\nfunc createRun(opts *CreateOptions) error {\n\trepo, err := opts.BaseRepo()\n\tif err != nil || repo == nil {\n\t\t// Not printing the error that came back from BaseRepo() here because we want\n\t\t// something clear, human friendly, and actionable.\n\t\treturn fmt.Errorf(\"a repository is required; re-run in a repository or supply one with --repo owner/name\")\n\t}\n\n\tif opts.ProblemStatement == \"\" {\n\t\tif opts.ProblemStatementFile != \"\" {\n\t\t\tfileContent, err := cmdutil.ReadFile(opts.ProblemStatementFile, opts.IO.In)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not read task description file: %w\", err)\n\t\t\t}\n\n\t\t\ttrimmed := strings.TrimSpace(string(fileContent))\n\t\t\tif trimmed == \"\" {\n\t\t\t\treturn errors.New(\"task description file cannot be empty\")\n\t\t\t}\n\n\t\t\topts.ProblemStatement = trimmed\n\t\t} else {\n\t\t\tdesc, err := opts.Prompter.MarkdownEditor(\"Enter the task description\", opts.ProblemStatement, false)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\ttrimmed := strings.TrimSpace(string(desc))\n\t\t\tif trimmed == \"\" {\n\t\t\t\treturn errors.New(\"a task description is required\")\n\t\t\t}\n\n\t\t\topts.ProblemStatement = trimmed\n\t\t}\n\t}\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/agent-task/create/create.go#L122-L158","documentation":"The second ParseFullReference failure branch: the regex matched but strconv.Atoi failed on the captured number. Because the regex already requires \\d+, this only fires on numeric overflow (numbers exceeding int64 on 64-bit platforms) or leading-zero edge platforms; it is effectively unreachable for normal input.","triggerScenarios":"Programmatically passing a reference like 'acme/widgets#99999999999999999999' whose number part exceeds the platform int range.","commonSituations":"Machine-generated references from external systems using 64-bit-plus IDs; fuzzed input. Human input never hits this.","solutions":["Use a realistic PR number within int64 range.","Validate the numeric portion in your caller if generating references programmatically."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if n, err := strconv.ParseInt(numStr, 10, 64); err != nil || n > math.MaxInt {\n    return errors.New(\"PR number out of range\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bound generated reference numbers to a sane PR number range."],"tags":["validation","parsing","overflow","unreachable"],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}