Skip to content

fix: a borderline satisfied score no longer ends the browser run early (#57) - #62

Open
bluzername wants to merge 1 commit into
awlevin:mainfrom
bluzername:fix-browser-runner-satisfied-coinflip
Open

bluzername wants to merge 1 commit into
awlevin:mainfrom
bluzername:fix-browser-runner-satisfied-coinflip

Conversation

@bluzername

Copy link
Copy Markdown

Fixes the first part of #57 (the stop-rule bug; the type_text insertText/select note in the same issue is a separate concern, left out so this stays one fix).

browser/runner.py stopped the run as done on kind == "done" or decision.satisfied.noul >= 0.5. A noul of 0.5 is a coin flip, and it could override a step where the classifier had already chosen a confident action, like click: the run ended right after that action ran, with no second look, before the step the classifier actually meant to take next could happen. The desktop loop does not have this problem - it stops only on done/none, and every stop goes to the writer for a check - but the browser loop has no writer review of a stop, so this coin flip alone decided it.

What changed:

  • run_goal (browser/runner.py): only kind == "done" ends the run as done now. decision.satisfied.noul is still recorded on the Step for the run log, it just cannot override the classifier's own choice of action.

Test evidence: FakeTypeSafe in tests/test_browser_loop.py can now take an optional per-step satisfied value (third item of the step tuple, defaults to 0.0 like before, so every existing test is unaffected). New test: a confident click at satisfied=0.5 now runs both steps (click then done) instead of stopping after the click alone. RED confirmed against the old code (["click"] instead of ["click", "done"]), then GREEN. Full suite: 731 passed (730 + 1 new), 2 skipped, 1 xfailed, unchanged otherwise. ruff check and ruff format --check both clean.

I not a maintainer here, just opening this for review.

browser/runner.py stopped the run as done on kind == "done" OR
decision.satisfied.noul >= 0.5. 0.5 is a coin flip, and it could override a
step where the classifier chose a confident action like click: the run
ended right after that action, with no second look, before the chosen
action's own next step could run. The desktop loop does not have this
problem, it stops only on done/none and every stop goes to the writer to
check; the browser loop has no writer review, so this coin flip was the
only thing deciding it.

Now only kind == "done" ends the run as done. satisfied is still recorded
on the Step for the run log, it just cannot override the classifier's own
choice of action any more.

New test in tests/test_browser_loop.py (FakeTypeSafe steps can now carry a
per-step satisfied value): a confident click at satisfied=0.5 runs to
completion over 2 steps instead of stopping after step 1. RED confirmed
against the old code (it stopped after the click, 1 step not 2), then
GREEN. Full suite 731 passed (730 + 1 new), ruff clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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