Skip to content

fix: reject nonpositive autonomous iteration limits - #470

Open
00200200 wants to merge 1 commit into
anthropics:mainfrom
00200200:codex/validate-iteration-limit
Open

00200200 wants to merge 1 commit into
anthropics:mainfrom
00200200:codex/validate-iteration-limit

Conversation

@00200200

Copy link
Copy Markdown

--max-iterations 0 currently starts an unlimited run because the loop checks the limit by truthiness. Negative limits are accepted but perform no work. Reject nonpositive limits at argument parsing, while retaining the unlimited default when the flag is omitted.

Validation: exercised the CLI entrypoint with a mocked async agent for omitted, 1, 3, 0, -1, and -10 limits. Baseline: 3 failed/3 passed; candidate: 6 passed. Invalid limits exit 2 before invoking the agent. The new tests pass Ruff and git diff --check passes. No API calls were made.

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.

1 participant