Skip to content

Validate task argument early in loop command#37

Merged
johnnygreco merged 2 commits intomainfrom
fix/require-task-for-loop
Mar 14, 2026
Merged

Validate task argument early in loop command#37
johnnygreco merged 2 commits intomainfrom
fix/require-task-for-loop

Conversation

@johnnygreco
Copy link
Copy Markdown
Owner

@johnnygreco johnnygreco commented Mar 14, 2026

Summary

  • Issue run and submit should show help when called without a task #30 reported that run and submit silently proceeded without a task. Those commands were replaced with migration shims in PR Rewrite CLI with purpose-built subcommands #32, but the same problem remained in the loop command: it accepts task as Optional[str] yet the engine always requires it for loop mode, causing a confusing late error after config loading and banner printing.
  • Adds early validation in the loop CLI command: errors immediately if neither task nor --resume-run is provided.
  • pipe is intentionally left with optional task since pipe mode genuinely works without one.

Closes #30

Test plan

  • New test test_loop_without_task_errors verifies early error before any engine work
  • All 323 existing tests pass
  • ruff check and format pass

The loop command accepted task as Optional[str] but always requires it
at runtime, causing a confusing late error deep in the engine. Add early
validation that either task or --resume-run is provided before any work
begins.

Closes #30
@johnnygreco johnnygreco merged commit 6aae597 into main Mar 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run and submit should show help when called without a task

1 participant