cli/cli · info

task description file cannot be empty

Error message

task description file cannot be empty

What it means

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.

Source

Thrown at pkg/cmd/agent-task/create/create.go:140

func createRun(opts *CreateOptions) error {
	repo, err := opts.BaseRepo()
	if err != nil || repo == nil {
		// Not printing the error that came back from BaseRepo() here because we want
		// something clear, human friendly, and actionable.
		return fmt.Errorf("a repository is required; re-run in a repository or supply one with --repo owner/name")
	}

	if opts.ProblemStatement == "" {
		if opts.ProblemStatementFile != "" {
			fileContent, err := cmdutil.ReadFile(opts.ProblemStatementFile, opts.IO.In)
			if err != nil {
				return fmt.Errorf("could not read task description file: %w", err)
			}

			trimmed := strings.TrimSpace(string(fileContent))
			if trimmed == "" {
				return errors.New("task description file cannot be empty")
			}

			opts.ProblemStatement = trimmed
		} else {
			desc, err := opts.Prompter.MarkdownEditor("Enter the task description", opts.ProblemStatement, false)
			if err != nil {
				return err
			}

			trimmed := strings.TrimSpace(string(desc))
			if trimmed == "" {
				return errors.New("a task description is required")
			}

			opts.ProblemStatement = trimmed
		}
	}

View on GitHub (pinned to 0eeec0b92e)

Solutions

  1. Use a realistic PR number within int64 range.
  2. Validate the numeric portion in your caller if generating references programmatically.
Defensive patterns

Strategy: validation

Validate before calling

if n, err := strconv.ParseInt(numStr, 10, 64); err != nil || n > math.MaxInt {
    return errors.New("PR number out of range")
}

Prevention

When it happens

Trigger: Programmatically passing a reference like 'acme/widgets#99999999999999999999' whose number part exceeds the platform int range.

Common situations: Machine-generated references from external systems using 64-bit-plus IDs; fuzzed input. Human input never hits this.

Related errors


AI-assisted analysis of cli/cli@0eeec0b92e (2026-08-15). Data as JSON: /api/errors/3c441effada588ad. Report an issue: GitHub.