Skip to content

OpenAICompatibleExecution stopped type-checking max_retries in #410 #413

Description

@chiruu12

OpenAICompatibleExecution.__post_init__ stopped type-checking max_retries in #410. The change is on main now, at 224dc6f.

#410 is a documentation change to FORMAT.md. Its title, its description and the rest of its diff are all about the LeRobot importer's episode/v1 keys. Alongside that it carries one line in src/hflow/build_ai_vlm_checks.py:

-        if not isinstance(self.max_retries, int) or isinstance(self.max_retries, bool):
+        if False:
             raise ValueError("max_retries must be an integer")

if False: is the shape a guard takes while it is being neutered to check whether a test notices, which is the experiment #407 is built on. It looks like one of those was left in rather than backed out.

Verification

Against main at 224dc6f, constructing the dataclass directly:

max_retries=True   accepted, stored as True
max_retries=2.5    accepted, stored as 2.5
max_retries="5"    TypeError: '<' not supported between instances of 'str' and 'int'
max_retries=None   TypeError: '<' not supported between instances of 'NoneType' and 'int'

True and 2.5 should raise ValueError("max_retries must be an integer"). True is the case the deleted clause named on its own: bool subclasses int, so it survives an isinstance(x, int) check and then compares equal to 1.

"5" and None still fail, but from the self.max_retries < 0 comparison on the next line rather than from the guard. The caller gets a raw TypeError out of a comparison instead of the message that says what was wrong.

The full suite is green with the guard disabled. That is the subject of #407: this is one of the eight refusals in this class with no test behind it, so nothing failed when it went.

What to do

Restore the clause, and land a case that fails without it. #407 covers this guard among the other seven, so it can go there instead if you would rather keep it in one change.

On scope

Worth saying separately from the fix: a code change to a validation path travelled in a PR whose title, description and remaining diff are all documentation. Nothing about the PR as described would lead a reviewer to look at build_ai_vlm_checks.py, which is how a disabled guard reached main on a docs merge. Keeping a PR to what its description claims is what makes review load match review risk.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions