Skip to content

fix(sdk): ignore a boolean max_iteration_per_run instead of reading it as 1 - #6428

Merged
VascoSch92 merged 2 commits into
OpenHands:mainfrom
yftx293:fix/yaml-boolean-max-iteration
Nov 4, 2026
Merged

VascoSch92 merged 2 commits into
OpenHands:mainfrom
yftx293:fix/yaml-boolean-max-iteration

Conversation

@yftx293

@yftx293 yftx293 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

Fixed the boolean iteration limit from #6348. I reviewed the diff and the test; a yes/no in frontmatter must not cap a run at one.


AGENT:

Why

_extract_max_iteration_per_run accepted any int, and bool is an int in Python. YAML reads an unquoted yes/no/on/off as a boolean, so max_iteration_per_run: yes produced True — which is 1 — silently capping the subagent at a single iteration. The sibling _extract_max_budget_per_run already rejects booleans, so the two frontmatter keys disagreed.

Summary

Issue Number

Part of #6348 (menu sub-item: "_extract_max_iteration_per_run accepts YAML booleans as ints ... so 'yes' silently caps a run at 1")

How to Test

uv run pytest tests/sdk/subagent/test_subagent_schema.py -k boolean_max_iteration

Before this change AgentDefinition.load reports max_iteration_per_run=1; after, it is None. The tests/sdk/subagent/ suite is 130 passed, with one pre-existing environment failure (test_register_file_agents_skips_agent_with_missing_skill) that fails the same way on unpatched main. ruff check/format on the touched files are clean.

Type

  • Bug fix

Notes

A quoted "yes" still goes through the string branch and fails int(), as before; only the YAML boolean form changed.

The test only checked that the value was not 1, so it would also pass if a boolean were read as 0. Assert None, which is what the fix returns.
@VascoSch92
VascoSch92 enabled auto-merge (squash) November 4, 2026 09:51

@VascoSch92 VascoSch92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@VascoSch92
VascoSch92 merged commit b18e819 into OpenHands:main Nov 4, 2026
46 of 47 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.

2 participants