Skip to content

Fix max_steps=0 being silently ignored in run() - #2542

Open
meddadaek wants to merge 1 commit into
huggingface:mainfrom
meddadaek:fix-max-steps-zero
Open

Fix max_steps=0 being silently ignored in run()#2542
meddadaek wants to merge 1 commit into
huggingface:mainfrom
meddadaek:fix-max-steps-zero

Conversation

@meddadaek

Copy link
Copy Markdown

Closes #2458

max_steps = max_steps or self.max_steps treats max_steps=0 as
falsy, so passing max_steps=0 silently falls back to the agent's
default instead of actually running zero steps. Changed to an
explicit None check so 0 is respected.

@kuangmi-bit

Copy link
Copy Markdown

Bumping this for visibility — it's a 1-line real bug: max_steps=0 is silently ignored because max_steps or self.max_steps treats 0 as falsy. Closes #2458.

Tests pass. The fix is minimal — changed or to an explicit None check.

Also have 4 companion test PRs adding test coverage for existing issues (#2541, #2543, #2544, #2545) — all mergeable, zero conflicts. Happy to rebase any of them if needed.

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.

BUG: max_steps=0 silently ignored due to falsy-value or operator

2 participants